ÈçºÎ½«php»ñµÃµÄʱ¼äת»»Îª±±¾©Ê±¼ä
´Óphp5.10¿ªÊ¼£¬phpÖмÓÈëÁËʱÇøµÄÉèÖã¬ÔÚphpÖÐÏÔʾµÄʱ¼ä¶¼ÊǸñÁÖÍþÖαê׼ʱ¼ä£¬Õâ¾ÍÔì³ÉÁËÎÒÃÇÖйúµÄÓû§»á²î°Ë¸öСʱµÄÎÊÌ⣡
Ïà¹ØÉèÖÃÊÇÐÞ¸Äphp.iniÖÐµÄ date.timezone ²ÎÊý£º
[Date]
; Defines the default timezone used by the date functions
;date.timezone =
ĬÈÏÊǹرյģ¬Ö»Ðè°Ñ×¢ÊÍÈ¥µô£¬¸ÄΪ¼´¿É
[Date]
; Defines the default timezone used by the date functions
date.timezone = PRC
ÆäÖÐPRCÊÇ“ÖлªÈËÃñ¹²ºÍ¹ú”£¡
ÆäËûÑ¡Ïî¿ÉÒԲο¼phpÊֲᡣ
²»¹ýÕâÉÏÃæµÄÑÇÖÞµØÇø©µôÁËÎÒÃǵÄÊ׶¼±±¾©£¬²»ÖªµÀÀÏÍâÊDz»ÊǹÊÒâµÄ£¡
Èç¹ûûÓÐÐÞ¸Äphp.iniµÄȨÏÞ£¬Ö»ÐèÒªÔÚµ÷ÓÃʱ¼äÈÕÆÚº¯ÊýµÄʱºò£¬µ÷Óà date_default_timezone_set(’PRC’) ¼´¿É£¡
Ò²¿ÉÒÔµ÷ÓÃdate_default_timezone_get()À´²é¿´µ±Ç°µÄʱÇøÉèÖã¡
關ì¶XXX£¬´ó陸內µØ¿ÉÓõÄÖµÊÇ£º
Asia/Chongqing £¬Asia/Shanghai £¬Asia/Urumqi £¨ÒÀ´Î為ÖØ慶£¬ÉϺ££¬烏魯ľ齊)
¸Ų̂µØ區¿ÉÓãºAsia/Macao £¬Asia/Hong_Kong £¬Asia/Taipei £¨ÒÀ´Î為°Ä門£¬Ïã¸Û£¬Ì¨±±£©
̨灣µØÇø¿É設為£ºdate.timezone = "Asia//Taipei"
還ÓÐмÓÆ£ºAsia/Singapore
PHP5ÖеÄʱ¼äÏà²î°ËСʱµÄ½â¾ö°ì·¨
°²×°ºÃphp5ºó£¬ÔÚÂÛ̳²»¾Òâ¼ä£¬ÔÚÂÛ̳ÉÏ¿´µ½ÓÐÈË˵php5.1.2µÄʱ¼äÏÔʾÕûÕûÉÙ8¸öСʱ£¬
<?php
echo date("Y-m-d H:i:s");
?>
½á¹û×Ô¼º²âÊÔ¹ûÈ»ÊÇÏà²î8Сʱ¡£
ºóÀ´¾¹ýÔÚÂÛ̳ÉÏÕÒ×ÊÁÏ£¬½á¹ûÖÕÓÚ½â¾ö£¬ÔÚphp5ÒÔ¼°ÆðÒÔÉϵİ汾£¬ÒªÊä³ö±¾µØµÄʱ¼ä£¨ÏÞÖйú£©£¬¿ÉÒÔÕâôд´úÂ룺
<?php
date_default_timezone_set('Asia/Shanghai');
echo date('Y-m-d H:i:s');
?>
Ò²¿ÉÒÔÕâÑùд´úÂë:
<?php
date_default_timezone_set('Asia/Chongqing');
echo date('Y-m-d H:i:s');
?>
ÕâÑù ʱ¼äÏà²î°ËСʱµÄÎÊÌâ¾Í½â¾öÁË!!~~~
Ïà¹ØÎĵµ£º
ÔÎÄÁ´½Ó£ºhttp://www.phpdo.net/index.php/20100409/54.html
ÈçºÎÔÚPHPÖд´½¨Êý×éÄØ£¿
ÔÚPHPÖÐʹÓÃarrayº¯ÊýÀ´´´½¨Ò»¸öÊý×飬ËüÔÊÐíÒ»¶¨ÊýÁ¿ÓöººÅkey=>value²ÎÊý¡£Key¿ÉÒÔÊÇinteger»òÕßstringÀàÐÍ£¬value¿ÉÒÔÊÇÈκÎÖµ¡£
ÀýÈ磺
<?php
$array = array(“php1″=>”phpdo”, ......
µ¼¶Á£º ¡¡
¡¡Apache: ¡¡
¡¡¿ªÆô httpd.conf£¬¼ÓÈëÒÔÏÂÁ½ÐÐ: ¡¡
¡¡QUOTE: ¡¡
¡¡ServerTokens ProductOnly ¡¡
¡¡ServerSignature Off ¡¡
¡¡PHP: ¡¡
¡¡Òþ²Ø PHP °æ±¾¾ÍÊÇÒþ²Ø "X-Powered-By: PHP/5.1.2-1+b1" Õâ¸ö£¬¿ªÆô php.ini£¬¼ÓÈë: ¡¡
¡¡QUOTE: ¡¡
¡¡expose_php = Off ¡¡
¡¡Apache ½ûֹĿ¼ä¯ÀÀ: ¡¡
¡¡½ûֹĿ ......
´´½¨ÎĵµÀàÐÍÉùÃ÷
Ò»°ã¶øÑÔ£¬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 ......
<?php
/********************************************************************
* FileName: class.msn.php
* by changwei, 2010-4-13
* Contact MSN: changwei0112@hotmail.com
* »ñÈ¡MSNºÃÓÑEmailÁбí
*
========================== ......