phpһЩ³£Ó÷½·¨
//½«ÍøÖ·µÄ²ÎÊýתΪ±äÁ¿,Èç:xxx.php?a=1&b=2,
//ÔËÐз½·¨ºó,echo $a."|".$b, ½á¹û:1|2
extract($_GET);
//unicodeתutf8£¬Èç:中»ò \u9865 ת ³É ÖÐÎÄ
function unescape($str) {
$str = rawurldecode($str);
preg_match_all("/(?:%u.{4})|&#x.{4};|&#\d+;|.+/U",$str,$r);
$ar = $r[0];
//print_r($ar);
foreach($ar as $k=>$v) {
if(substr($v,0,2) == "%u")
$ar[$k] = iconv("UCS-2","UTF-8",pack("H4",substr($v,-4)));
elseif(substr($v,0,3) == "&#x")
$ar[$k] = iconv("UCS-2","UTF-8",pack("H4",substr($v,3,-1)));
elseif(substr($v,0,2) == "&#") {
//echo substr($v,2,-1)."\n";
$ar[$k] = iconv("UCS-2","UTF-8",pack("n",substr($v,2,-1)));
}
}
return join("",$ar);
}
Ïà¹ØÎĵµ£º
ÌÚѶµÄQQ¿Õ¼ä¸ù¾Ý»áÔ±×ÊÁϼÆËãÉúÈÕ²¢ÌáÐѺÃÓÑ·¢ËÍÉúÈÕ×£¸££¬Ò»Ð©ÍøÕ¾Ò²ÓÐÀàËƵŦÄÜ£¬±ÈÈçÌáÇ°¼¸ÌìÏò»áÔ±·¢ËÍ×£¸£Óʼþ¡£
´óÖ¹ý³ÌÈçÏ£ºÉèÖÃÒ»¸ö×Ô¶¯Ö´ÐгÌÐò£¬±ÈÈçLinuxÏ¿ÉÒÔÓÃCronTab ʵÏÖ¡£´Ë³ÌÐòÿÌìÖ´ÐÐÒ»´Î¶ÁÈ¡»áÔ±×ÊÁÏÖеÄbirth_day,
ÅжÏÊÇ·ñ·ûºÏÉèÖõķ¢ËÍÒªÇó¡£¼ÙÈçÉèÖÃÌáÇ°Èý ......
PHPÖеÄstristr()£¬strstr()£¬strpos()ËٶȱȽÏ
²âËÙ´úÂë:
<?php
function getmicrotime()
{
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
......
header() is used to send raw HTTP headers. See the HTTP/1.1 specification for more information on HTTP headers.
ʹÓ÷¶Àý
·¶ÀýÒ»:
<?PHP
Header("Location: http://www.phpchina.com";);
exit;//ÔÚÿ¸öÖض¨ÏòÖ®ºó¶¼±ØÐë¼ÓÉÏ“exit",±ÜÃâ·¢Éú´íÎóºó£¬¼ÌÐøÖ´ÐС£
?>
<?php
head ......
ÎÒÏÖÔÚÓÐÕâÑùÒ»¸öÐèÇ󣬻òÐí×öc++³ÌÐòµÄ×ö¹ýÕâÑùµÄÍæÒâ¶ù£¬ÎÒÏÖÔÚÏëÓÃphpÀ´ÊµÏÖ£¬´ÓûÅöµ½ÕâÑùµÄÇé¿ö£¬ËùÒÔÓеãã¡£»¹Çë¸ßÈËÖ¸µãŶ£¬²»Ê¤¸Ð¼¤£¬Çë²é¿´ÎÒÉÏ´«µÄ½Øͼ£¬¸´ÖƹýÀ´£¬ÑùʽÂÒÁË¡£
ÃèÊöÒ»ÏÂÐèÇó°É£º¾ÍÊÇÔÚÎı¾ÀïÃæÓÃÖƱí·û»³ö±í¸ñÊ ......