ʲôÊÇphp²É¼¯³ÌÐò£¿
php²É¼¯³ÌÐò£¬Ö÷ÒªÊÇÓÃÓÚ×Ô¶¯ËѼ¯ÍøÂçÉÏwebÒ³ÀïÌض¨ÄÚÈÝ£¬ÓÃphpÓïÑÔдµÄweb³ÌÐò£¬ÔËÐÐÓÚÖ§³ÖphpµÄƽ̨ÉÏ¡£Ì¸µ½¡°×Ô¶¯ËѼ¯¡±£¬Äã¿ÉÄÜÁªÏëµ½°Ù¶Ègoole£¬ÁªÏëµ½ËÑË÷ÒýÇæËù×öµÄÊÂÇé¡£php²É¼¯³ÌÐò£¬ÕýÊÇ×öÀàËƵŤ×÷¡£
ΪʲôҪ²É¼¯£¿
»¥ÁªÍøÕýÒÔ·É¿ìµÄËÙ¶ÈÔÚ·¢Õ¹£¬webÊý¾ÝÿÌìÒÔ¼¸ºÎ¼¶Êý¾ÝÁ¿µÝÔö£¬Ãæ¶ÔÕâÅÓ´óµÄÊý¾Ý£¬×÷Ϊһ¸öÍøÕ¾¹ÜÀíÔ±µÄÄ㣬¸ÃÈçºÎËѼ¯×Ô¼ºËùÐèÒªµÄÐÅÏ¢ÄØ£¿Ìرð¶Ôij¸ö »òij¼¸¸öͬÀàÍøÕ¾£¬ÄãÐèÒªËüÃǵĴóÁ¿ÐÅÏ¢£¬À´³äʵÄãµÄÍøÕ¾ÄÚÈÝ£¬ÄѵÀ¾ÍÖ»Äܸ´ÖÆÕ³ÌùµÄ¹ýÈÕ×ÓÂð£¿Ò»¸öÍøÕ¾¹ÜÀíÔ±£¬ÄãÕæµÄ¾ÍµÃ»¨´óÁ¿Ê±¼äÈ¥¸ãÔ´´ÄÚÈÝ£¬¶øÓë Õû¸ö»¥ÁªÍøÐÅÏ¢Á¿µÄ·¢Õ¹ËÙ¶ÈÍѽÚÂð£¿ÕâЩÎÊÌâµÄ½â¾ö·½·¨Ö»ÓÐÒ»¸ö£º²É¼¯¡£Èç¹ûÓÐÄÇôһ¸ö³ÌÐò£¬Äã°ïÄãµÄÍøÕ¾×Ô¶¯»ò°ë×Ô¶¯µÄ²É¼¯ÄãËùÐèÒªµÄÌض¨ÄÚÈÝ£¬¼´Ê±¸ü ÐÂÄãÍøÕ¾µÄÐÅÏ¢£¬ÊÇ·ñÊÇÄãÃÎÃÂÒÔÇóµÄÄØ£¿Õâ¾ÍÊDzɼ¯³ÌÐò³öÏÖµÄÔÒòËùÔÚ¡£
//»ñµÃµ±Ç°µÄ½Å±¾ÍøÖ·
function get_php_url(){
if(!empty($_SERVER["REQUEST_URI"])){
$scriptName = $_SERVER["REQUEST_URI"];
$nowurl = $scriptName;
}else{
$scriptName = $_SERVER["PHP_SELF"];
if(empty($_SERVER["QUERY_STRING"])) $nowurl = $scriptName;
else $nowurl = $scriptName."?".$_SERVER["QUERY_STRING"];
}
return $nowurl;
}
//°ÑÈ«½ÇÊý×ÖתΪ°ë½ÇÊý×Ö
function GetAlabNum($fnum){
$nums = array("£°","£±","£²","£³","£´","£µ","£¶","£·","£¸","£¹");
$fnums = "0123456789";
for($i=0;$i<=9;$i++) $fnum = str_replace($nums[$i],$fnums[$i],$fnum);
$fnum = ereg_replace("[^0-9\.]|^0{1,}","",$fnum);
if($fnum=="") $fnum=0;
return $fnum;
}
//È¥³ýHTML±ê¼Ç
function Text2Html($txt){
$txt = str_replace(" ","¡¡",$txt);
$txt = str_replace("<","<",$txt);
$txt = str_replace(">",">",$txt);
$txt = PReg_replace("/[\r\n]{1,}/isU","<br/>\r\n",$txt);
return $txt;
}
//Çå³ýHTML±ê¼Ç
function ClearHtml($str){
$str = str_replace('<','<',$str);
$str = str_replace('>','>',$str);
return $str;
}
//Ïà¶Ô·¾¶×ª»¯³É¾ø¶Ô·¾¶
function relative_to_absolute($content, $feed_url) {
preg_match('/(http|https|ftp):\/\//', $feed_url, $protocol);
$server_url = preg_replace("/(http|https|ftp|news):\/\//", "", $feed_url);
$server_url = preg_replace("/\/.*/", "", $server_url);
if ($server_url == '') {
return $content;
}
if (isset($protocol[0])) {
$new_content = preg_replace('/href="\\//', 'href="'.$protocol[0].$server_url.'/', $content);
$new_content = preg_replace('/src="\\//', 'src="'.$protocol[0].$server_url.'/', $new_content);
} else {
$new_content = $content;
}
return $new_content;
}
//È¡µÃËùÓÐÁ´½Ó
function get_all_url($code){
preg_match_all('/<a\s+href=["|\']?([^>"\' ]+)["|\']?\s*[^>]*>([^>]+)<\/a>/i',$code,$arr);
return array('name'=>$arr[2],'url'=>$arr[1]);
}
//»ñÈ¡Ö¸¶¨±ê¼ÇÖеÄÄÚÈÝ
function get_tag_data($str, $start, $end){
if ( $start == '' || $end == '' ){
return;
}
$str = explode($start, $str);
$str = explode($end, $str[1]);
return $str[0];
}
//HTML±í¸ñµÄÿÐÐתΪCSV¸ñʽÊý×é
function get_tr_array($table) {
$table = preg_replace("'<td[^>]*?>'si",'"',$table);
$table = str_replace("</td>",'",',$table);
$table = str_replace("</tr>","{tr}",$table);
//È¥µô HTML ±ê¼Ç
$table = preg_replace("'<[\/\!]*?[^<>]*?>'si","",$table);
//È¥µô¿Õ°××Ö·û
$table = preg_replace("'([\r\n])[\s]+'","",$table);
$table = str_replace(" ","",$table);
$table = str_replace(" ","",$table);
$table = explode(",{tr}",$table);
array_pop($table);
return $table;
}
//½«HTML±í¸ñµÄÿÐÐÿÁÐתΪÊý×飬²É¼¯±í¸ñÊý¾Ý
function get_td_array($table) {
$table = preg_replace("'<table[^>]*?>'si","",$table);
$table = preg_replace("'<tr[^>]*?>'si","",$table);
$table = preg_replace("'<td[^>]*?>'si","",$table);
$table = str_replace("</tr>","{tr}",$table);
$table = str_replace("</td>","{td}",$table);
//È¥µô HTML ±ê¼Ç
$table = preg_replace("'<[\/\!]*?[^<>]*?>'si","",$table);
//È¥µô¿Õ°××Ö·û
$table = preg_replace("'([\r\n])[\s]+'","",$table);
$table = str_replace(" ","",$table);
$table = str_replace(" ","",$table);
$table = explode('{tr}', $table);
array_pop($table);
foreach ($table as $key=>$tr) {
$td = explode('{td}', $tr);
array_pop($td);
$td_array[] = $td;
}
return $td_array;
}
//·µ»Ø×Ö·û´®ÖеÄËùÓе¥´Ê $distinct=true È¥³ýÖظ´
function split_en_str($str,$distinct=true) {
preg_match_all('/([a-zA-Z]+)/',$str,$match);
if ($distinct == true) {
$match[1] = array_unique($match[1]);
}
sort($match[1]);
return $match[1];
}
ÍƼöÐÅÏ¢
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- php³£ÓÃÕýÔò±í´ïʽ
- phpÐÔÄܼà²âÄ£¿éXHProf
- ÈÃCI¿ò¼ÜÖ§³Öservice²ã
- ʹÓÃPHPÉú³É´øLOGOµÄ¸öÐÔ»¯¶þάÂëͼÏñ
- ¹ØÓÚCodeIgniterÄã¿ÉÄܲ»ÖªµÀµÄ5¸ö֪ʶµã
- Memcache ºÁÃ뼶³¬Ê±¼°ÆäËû³£¼ûÎÊÌâ»ã×Ü
- [PHP±Ê¼Ç]PHPQueryÒ»¸ö´¦ÀíDOMµÄÀûÆ÷
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- PHP»ñÈ¡Óû§µÄÕæʵIP£¬²¢ÅжÏÊÇ·ñÄÚÍøIP
- PHP ´íÎóÈÕÖ¾ error_log
- ÀûÓÃbigpipe»úÖÆʵÏÖÒ³ÃæÄ£¿éµÄÒì²½äÖȾ chunked¼¼Êõ
- php¿ØÖÆÎļþÏÂÔØËÙ¶È
- js + php ¶ÁÈ¡¡¢²¥·ÅÊÓƵÁ÷ ¼æÈÝfirefox£¬c....
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- UNICODE Óë UTF-8 µÄ¹Øϵ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- phpʹÓÃmb_detect_encoding¼ì²â×Ö·û´®±àÂë
ÆÀÂÛ