PHPÖÐħÊõ³£Á¿
__LINE__ ÎļþÖеĵ±Ç°Ðкš£
__FILE__ ÎļþµÄÍêÕû·¾¶ºÍÎļþÃû¡£Èç¹ûÓÃÔÚ±»°üº¬ÎļþÖУ¬Ôò·µ»Ø±»°üº¬µÄÎļþÃû¡£×Ô PHP 4.0.2 Æð£¬__FILE__
×ÜÊÇ°üº¬Ò»¸ö¾ø¶Ô·¾¶£¨Èç¹ûÊÇ·ûºÅÁ¬½Ó£¬ÔòÊǽâÎöºóµÄ¾ø¶Ô·¾¶£©£¬¶øÔÚ´Ë֮ǰµÄ°æ±¾ÓÐʱ»á°üº¬Ò»¸öÏà¶Ô·¾¶¡£
__DIR__ ÎļþËùÔÚµÄĿ¼¡£Èç¹ûÓÃÔÚ±»°üÀ¨ÎļþÖУ¬Ôò·µ»Ø±»°üÀ¨µÄÎļþËùÔÚµÄĿ¼¡£ËüµÈ¼ÛÓÚ
dirname(__FILE__)¡£³ý·ÇÊǸùĿ¼£¬·ñÔòĿ¼ÖÐÃû²»°üÀ¨Ä©Î²µÄб¸Ü¡££¨PHP 5.3.0ÖÐÐÂÔö£© =
__FUNCTION__ º¯ÊýÃû³Æ£¨PHP 4.3.0 мӣ©¡£×Ô PHP 5 Æð±¾³£Á¿·µ»Ø¸Ãº¯Êý±»¶¨ÒåʱµÄÃû×Ö£¨Çø·Ö´óСд£©¡£ÔÚ
PHP 4 ÖиÃÖµ×ÜÊÇСд×ÖĸµÄ¡£
__CLASS__ ÀàµÄÃû³Æ£¨PHP 4.3.0 мӣ©¡£×Ô PHP 5 Æð±¾³£Á¿·µ»Ø¸ÃÀà±»¶¨ÒåʱµÄÃû×Ö£¨Çø·Ö´óСд£©¡£ÔÚ PHP 4
ÖиÃÖµ×ÜÊÇСд×ÖĸµÄ¡£
__METHOD__ ÀàµÄ·½·¨Ãû£¨PHP 5.0.0 мӣ©¡£·µ»Ø¸Ã·½·¨±»¶¨ÒåʱµÄÃû×Ö£¨Çø·Ö´óСд£©¡£
__NAMESPACE__ µ±Ç°ÃüÃû¿Õ¼äµÄÃû³Æ£¨´óСдÃô¸Ð£©¡£Õâ¸ö³£Á¿ÊÇÔÚ±àÒëʱ¶¨ÒåµÄ£¨PHP 5.3.0 ÐÂÔö£©
Ïà¹ØÎĵµ£º
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" media="all" href="css/style.css" />
<meta http-equiv="Content-Type" content="text/html; ......
function htmldecode($str)
{
if(empty($str)) return;
if($str=="") return $str;
$str=str_replace("&",chr(34),$str);
$str=str_replace(">",">",$str);
$str=str_replace("<","<",$str);
$str=str_replace("&","&",$str);
$str=str_replace(" ",chr(32),$str);
$str=str_replace(" ", ......
×òÌìÔÚ¿´ÎÒµÄgoogle¿ìѶʱ¿´µ½ÁËphpÖеÄÕâ¸öº¯Êý£¬·¢ÏÖÎÒºÃÏñ¶ÔÕâ¸öº¯Êý²»ÊÇÌرðµÄÁ˽âÂð
²é¿´ÁËÊֲᣬ·¢ÏÖÁËÕâ¸öº¯ÊýÖ÷ÒªÊÇתÒåÁËÊý¾Ý¿âÖеÄÌØÊâ×Ö·û£¬±ÈÈç ' µ¥ÒýºÅ " Ë«ÒýºÅµÈÔÚÊý¾Ý¿âÖеÄÌØÊâµÄ×Ö·û
µ±È»ÁËÕâ¸öaddslashesʹÓÃÊÇÒªÏȼì²émagic_quotes_gpcÕâ¸öµÄϵͳÅäÖÃÁË£¬Èç¹ûÅäÖÃÁ˾ͱØÐë²»ÄÜÔÚʹÓÃÁË£¬Èç¹ûÁ½ ......
MySQLÊý¾Ý¿â±àÂë¡¢htmlÒ³Ãæ±àÂë¡¢PHP»òhtmlÎļþ±¾Éí±àÂëҪȫ²¿Ò»Ö¡£
1¡¢MySQLÊý¾Ý¿â±àÂ룺½¨Á¢Êý¾Ý¿âʱָ¶¨±àÂ루Èçgbk_chinese_ci)£¬½¨Á¢Êý¾Ý±í¡¢½¨Á¢×ֶΡ¢²åÈëÊý¾Ýʱ²»ÒªÖ¸¶¨±àÂ룬»á×Ô¶¯¼Ì³ÐÊý¾Ý¿âµÄ±àÂë¡£
Êý¾Ý¿âÁ¬½Óʱ£¬Ò²ÓбàÂ룬¿ÉÒÔÔÚÁ¬½ÓÍêÊý¾Ý¿âºó£¬Ö´ÐÐ
mysql_query(‘SET NAMES gbk’);//½«gbk» ......
header
(PHP 3, PHP 4, PHP 5)
header -- ·¢ËÍÒ»¸öÔʼ HTTP ±êÍ·
˵Ã÷
void header ( string string [, bool replace [, int http_response_code]] )
header() º¯ÊýÓÃÀ´·¢ËÍÒ»¸öÔʼ HTTP ±êÍ·¡£ÓÐ¹Ø HTTP ±êÍ·µÄ¸ü¶àÄÚÈݼû HTTP/1.1 ¹æ·¶¡£
¿ÉÑ¡²ÎÊý replace Ö¸Ã÷ÊÇÌæ»»µôÇ°Ò»ÌõÀàËƵıêÍ·»¹ÊÇÔö¼ÓÒ»ÌõÏàͬÀàÐ͵ ......