PHPÊý×Ö¼ÓÃܽâÃÜÀà
<?php
/* ----------------------------------------------------------------------------
* Script Name: encrypt.php
* Creation Date: 2008-4-7 10:36
* Last Modified: 2008-4-12 16:00
* Author: meyu
* Copyright (c) 2007
* Purpose: Êý×Ö×Ö·û´®¼òÒ×¼Ó½âÃÜ
* ----------------------------------------------------------------------------*/
class Encryption {
/**
* ×îÖÕµÄÃÜÎÄ´úÂ룬¿ÉÉèΪÈÎÒâ²»ÖØ¸´µÄ10λӢÎÄ×Ö·ûa-zA-Z
*/
private $replacement = 'urskydMeIV';
/**
* Ôö¼ÓµÄÃÜÎĵÚһ룬¿ÉÉèΪ1λ³ý0ÒÔÍâµÄÕûÊý£¬¼´ 1-9
*/
private $prefix = "8";
/**
* ¹«Ô¿,³¤¶ÈСÓÚ8λµÄÕýÕûÊý
*/
private $match = "111111";
/**
* ת»»ºó¶ÔÕÕÊý×é
*/
private $replaceenc;
private $replacedec;
function __construct() {
for($i =0; $i < 10; $i++) {
$this->replaceenc['/'.$i.'/'] = $this->replacement{$i};
$this->replacedec['/'.$this->replacement{$i}.'/'] = $i;
}
}
public function encrypt($str) {
return preg_replace(
array_keys($this->replaceenc),
$this->replaceenc,
$this->mynotin(preg_replace("/(.)(.)/", "${2}${1}", $str))
);
}
public function decrypt($str) {
return preg_replace("/(.)(.)/", "${2}${1}",
$this->mynotout(preg_replace(array_keys($this->replacedec),$this->replacedec,$str))
);
}
private function mynotin($str) {
$str_out = "";
$i = 0;
while(isset($str{7*$i})) {
$str_out .= (($this->prefix.substr($str, $i*7, 7))+0)^$this->match;
$i++;
}
return $str_out;
}
private function mynotout($str) {
$str_out = "";
$i = 0;
while(isset($str{8*$i})) {
$str_out .= substr((substr($str, $i*8, 8)+0)^$this->match, 1);
$i++;
}
return $str_out;
}
}
?>
Ïà¹ØÎĵµ£º
“ÊØÍûÐù”²©¿ÍÓÒ²à±ßÀ¸ÔÀ´Óиö“ÔӸДµÄÀ¸Ä¿£¬ÓÃÀ´¼Ç¼¶ÌµÄ¡¢²»ÄÜ´óÆª·ù³ÉÎĵĶ̾䣬»òÕß×Ô¼º±È½Ïϲ»¶µÄ¶Ì¾äºÍÑÔÂÛ¡£
Õâ¸öÀ¸Ä¿×ʼµ÷ÓÃ΢²©·¹·ñµÄAPIÀ´×öµÄ£¬ÒòΪÖÚËùÖÜÖªµÄÔµ¹Ê£¬·¹·ñÎÞ·¨Ê¹ÓÃÁË£¬ºóÀ´²ÉÓÃÌÚѶµÄÌÏÌÏAPIÀ´ÊµÏÖ.2010Äê1ÔÂ26ÈÕÌÏÌÏÒµÎñ½«»á¿ªÊ¼ºÍQQ¿Õ¼äÐÄÇéÕûºÏ£¬Ö»ÄÜ¿¼ÂÇ·ÅÆú¡£ ......
ÔÚPHPÖУ¬ÎļþÉÏ´«Ò»°ãÊÇͨ¹ýmove_uploaded_file£¨£©À´ÊµÏֵġ£
bool move_uploaded_file ( string filename, string destination )±¾º¯Êý¼ì²é²¢È·±£ÓÉ filename Ö¸¶¨µÄÎļþÊǺϷ¨µÄÉÏ´«Îļþ£¨¼´Í¨¹ý PHP µÄ HTTP POST ÉÏ´«»úÖÆËùÉÏ´«µÄ£©¡£Èç¹ûÎļþºÏ·¨£¬Ôò½«ÆäÒÆ¶¯ÎªÓÉ destination Ö¸¶¨µÄÎļþ¡£
Èç¹û filename ²»ÊǺϷ ......
Ö÷ҪʹÓÃÁË int substr_count ( string haystack, string needle [, int offset [, int length]] ) Õâ¸ö·½·¨,Õâ¸ö·½·¨±éÀú´ý²âµÄ×Ö·û´®$strÖÐÓÐûÓÐ$allergicWordÊý×éÖÐËù°üº¬µÄÃô¸Ð´Ê£º
$allergicWord = array('Ôà»°','ÂîÈË»°');
$str = 'Õâ ......
<?php
/*
* Created on 2010-3-11
* author:zhangfei
*ÎÒµÄÑéÖ¤ÂëÀà
*/
session_start();
class Check_Class{
public $h_img ;
public $c_back ;
public $c_front ;
//¹¹Ô캯Êý
function Check_Class(){
$h_img = imagecreate(100,30);
......