ѸËÙѧ»á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>”; 
    
     
	
	
    
    
	Ïà¹ØÎĵµ£º
        
    
    niginx°²×°Á÷³Ì
Èí¼þÏÂÔØ:--->
mkdir -p /home/dancebear/programe
cd /home/dancebear/programe
wget http://sysoev.ru/nginx/nginx-0.6.31.tar.gz
wget http://www.php.net/get/php-5.2.6.tar.gz/from/this/mirror
wget http://php-fpm.anight.org/downloads/head/php-5.2.6-fpm-0.5.8.diff.gz
wget http://dev ......
	
    
        
    
    ×î½üÐÂÂòÁ˸öµçÄÔ£¬ÏµÍ³ÊÇwindows7£¬window7ÔÚ½çÃæ£¬¹¦ÄÜ·½Ã涼ͦÈÃÈËÂúÒâµÄ£¬¸Ð¾õºÜˬ£¬²»Ë¬µÄÊÇÓÖÒªÖØÐ°²×°»·¾³ÁË¡£
ËùÓÐÈí¼þ¾ù°²×°ÔÚF:\server\ÏÂ
apacheĿ¼£ºF:\server\apache2.2
phpĿ¼£ºF:\server\php
msyqlĿ¼£ºF:\server\mysql
Ò»¡¢°²×°apache
°²×°apacheµÄ°æ±¾ÊÇ£ºhttpd-2.2.15-win32-x86-no_ssl.msi
° ......
	
    
        
    
    ´´½¨ÎĵµÀàÐÍÉùÃ÷
Ò»°ã¶øÑÔ£¬XMLÉùÃ÷·ÅÔÚÎĵµ¶¥²¿¡£ÔÚPHPÖÐÉùÃ÷Ê®·Ö¼òµ¥£ºÖ»ÐèʵÀý»¯Ò»¸öDOMÎĵµÀàµÄ¶ÔÏ󲢸³ÓèËüÒ»¸ö°æ±¾ºÅ¡£²é¿´³ÌÐòÇåµ¥A£º
³ÌÐòÇåµ¥ A
<?php
// create doctype
$dom = new DOMDocument("1.0");
// display document in browser as plain text 
// display document in browser as plain text ......
	
    
        
    
    CentOSµÄphp°æ±¾Ä¬ÈÏΪ5.1.6£¬È»ºóÔÚ5.2.9°æ±¾Ö®Ç°µÄµÄphp¶¼´æÔÚÒ»¸ö©¶´£¬µ«ÊÇÄ¿Ç°ÍøÉÏºÜ¶àµØ·½¶¼ÎÞ·¨Ê¹ÓÃyum update php*Éý¼¶µ½5.2.9£¬±È½Ï³£¼ûµÄÊÇÉý¼¶µ½5.2.6°æ±¾µÄ£¬¾¹ýËÑË÷¹úÍâ×ÊÁÏ£¬ÏÖÔÚÖÕÓÚÕÒµ½Ò»ÖÖÉý¼¶CentOSµÄphpµ½5.2.9µÄ·½·¨¡£
ÔËÐÐÏÂÃæÃüÁ
# wget http://download.fedora.redhat.com/pub/epel/5/i386/ep ......
	
    
        
    
    <?php 
set_time_limit(0);
$url='http://item.taobao.com/auction/item_detail.htm?xid=0db2&item_num_id=4512430274&cm_cat=50000671&pm2=1'; 
$ch = curl_init(); 
$timeout = 10; 
curl_setopt ($ch, CURLOPT_URL, $url); 
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt ($ch, CU ......