Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ѸËÙѧ»áPHP¼ÓÃܽâÃܼ¼ÇÉ

Ïл°ÉÙ˵,ÏȽ«ËüÃÇ´ò°ü³ÉÒ»¸öÎļþ¾Í½Ðfun.php°É
< ?php  
function passport_encrypt($txt, $key) {  
srand((double)microtime() * 1000000);  
$encrypt_key = md5(rand(0, 32000));  
$ctr = 0;  
$tmp = '';  
for($i = 0;$i < strlen($txt); $i++) {  
$ctr = $ctr == strlen($encrypt_key) ? 0 : $ctr;  
$tmp .= $encrypt_key[$ctr].($txt[$i]
 ^ $encrypt_key[$ctr++]);  
}  
return base64_encode(passport_key($tmp, $key));  
}  
function passport_decrypt($txt, $key) {  
$txt = passport_key(base64_decode($txt), $key);  
$tmp = '';  
for($i = 0;$i < strlen($txt); $i++) {  
$md5 = $txt[$i];  
$tmp .= $txt[++$i] ^ $md5;  
}  
return $tmp;  
}  
function passport_key($txt, $encrypt_key) {  
$encrypt_key = md5($encrypt_key);  
$ctr = 0;  
$tmp = '';  
for($i = 0; $i < strlen($txt); $i++) {  
$ctr = $ctr == strlen($encrypt_key) ? 0 : $ctr;  
$tmp .= $txt[$i] ^ $encrypt_key[$ctr++];  
}  
return $tmp;  
}  
?> 
ÒÔÏÂÊÇһЩʾÀý…¼ÓÉî¶ÔÕâÈý¸öPHP¼ÓÃܽâÃܺ¯ÊýµÄÀí½â…
 
//string.php  < ?php  include “fun.php”;  $txt = “This is a test”;  $key = “testkey”;  $encrypt = passport_encrypt($txt,$key);  $decrypt = passport_decrypt($encrypt,$key);  echo $txt.”< br>< hr>”;


Ïà¹ØÎĵµ£º

PHPÖÐʵÏÖ·Ç×èÈûģʽ

³ÌÐò·Ç×èÈûģʽ£¬ÕâÀïÒ²¿ÉÒÔÀí½â³É²¢·¢¡£¶ø²¢·¢ÓÖÔÝÇÒ¿ÉÒÔ·ÖΪÍøÂçÇëÇó²¢·¢
ºÍ±¾µØ²¢·¢
¡£
ÏÈ˵һÏÂÍøÂçÇëÇó²¢·¢
ÀíÂÛÃèÊö
¼ÙÉèÓÐÒ»¸öclient£¬³ÌÐòÂß¼­ÊÇÒªÇëÇóÈý¸ö²»Í¬µÄserver£¬´¦Àí¸÷×ÔµÄÏìÓ¦¡£´«Í³Ä£Ð͵±È»ÊÇ˳ÐòÖ´ÐУ¬ÏÈ·¢Ë͵ÚÒ»¸öÇëÇ󣬵ȴýÊÕµ½ÏìÓ¦Êý¾ÝºóÔÙ·¢Ë͵ڶþ¸öÇëÇó£¬ÒÔ´ËÀàÍÆ¡£¾ÍÏñÊǵ¥ºËCPU£¬Ò»´ÎÖ»ÄÜ´ ......

PHP rsyncÃüÁî½éÉÜ

rsync ÊÇÒ»¿î¸ßЧµÄÔ¶³ÌÊý¾Ý±¸·ÝºÍ¾µÏ󹤾ߣ¬¿É¿ìËÙµØͬ²½¶ą̀Ö÷»ú¼äµÄÎļþ£¬Æä¾ßÓÐÈçÏÂÌØÐÔ£º
Ö§³ÖÁ´½Ó¡¢ËùÓÐÕß¡¢×éÐÅÏ¢ÒÔ¼°È¨ÏÞÐÅÏ¢µÄ¿½±´£»
ͨ¹ýÔ¶³Ì shell£¨ssh, rsh£©½øÐд«Ê䣻
ÎÞÐëÌØÊâȨÏÞ¼´¿É°²×°Ê¹Óã»
Á÷Ë®ÏßʽÎļþ´«Êäģʽ£¬Îļþ´«ÊäЧÂʸߣ»
Ö§³ÖÄäÃû²Ù×÷£»
ͨ¹ýÔ¶³Ì shell ·½Ê½£º
rsync [OPTION] [USE ......

ѧϰphp Reflection£¨Ò»£©

¿´yii¿ò¼ÜÔ´ÂëµÄʱºò£¬·¢ÏÖÁË
ReflectionClassÕâ¸ö·½·¨£¬²Å·¢ÏÖÔ­À´ÊÇphp5µÄж«Î÷£¬ÓÚÊÇÉÔ΢Ñо¿ÁËÏ¡£phpµÄ·´ÉäapiÒ»¹²ÓУº
class 
Reflection 
{ }
interface Reflector 
{ }
class 
ReflectionException 
extends 
Exception 
{ }
class 
Re ......

php ³ÌÐòµÄ¹ú¼Ê»¯gettext

²½ÖèÒ»£º´î½¨»·¾³
1£¬Ê×ÏȲ鿴ÄãµÄphpÀ©Õ¹Ä¿Â¼ÏÂÊÇ·ñÓÐphp_gettext.dllÕâ¸ö
Îļþ£¬Èç¹ûûÓУ¬Õâ¾ÍÐèÒªÄã
ÏÂÔØÒ»¸ö»òÊÇ´ÓÆäËûµØ·½¿½±´Ò»¸ö£¬È»ºó·Åµ½phpÀ©Õ¹Ä¿Â¼¡£
2£¬´ò¿ªphp.ini£¬²é
ÕÒ”;extension=php_gettext.dll“ £¬È»ºóÈ¥³ý×¢ÊÍ£¬ÖØÆôapache¡£
²½Öè¶þ:Ô­Àí½²½â
¼ÙÈçÄãµÄû
Óйú¼Ê»¯µÄ³ÌÐòÀïÓÐÕâÑù ......

php Mod rewrite test

In the directory where you plan to install Elgg, do the following:
Create the file .htaccess and add these two lines
RewriteEngine on
RewriteRule ^testing.php$ modrewrite.php
This tells the webserver to load modrewrite.php when testing.php is
requested.
In order to get this test to work on ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ