PHP DATE( )º¯ÊýÓëϵͳʱ¼ä²î8Сʱ½â¾ö°ì·¨
Ò»£¬ÔÒò
´Óphp5.1.0¿ªÊ¼£¬php.iniÀï¼ÓÁËdate.timezoneÕâ¸öÑ¡Ï²¢ÇÒĬÈÏÇé¿öÏÂÊǹرյÄ
Ò²¾ÍÊÇÏÔʾµÄʱ¼ä£¨ÎÞÂÛÓÃʲôphpÃüÁ¶¼ÊǸñÁÖÍþÖαê׼ʱ¼ä
ºÍÎÒÃǵÄʱ¼ä£¨±±¾©Ê±¼ä£©²îÁËÕýºÃ8¸öСʱ¡£
¶þ£¬½â¾ö°ì·¨
·½·¨Ò»£ºÔÚ»ñȡʱ¼äÇ°¼ÓÈçÏ´úÂ룺
date_default_timezone_set(PRC);
·½·¨¶þ£º¸Äphp.iniÀïÃæµÄÅäÖÆ£¬¾ßÌå²Ù×÷ÈçÏ£º
´ò¿ªphp.ini²éÕÒdate.timezone È¥µôÇ°ÃæµÄ·ÖºÅ= ºóÃæ¼ÓXXX(PRC)£¬ÖØÆôhttp·þÎñ£¨Èçapache2»òiisµÈ£©¼´¿É
È磺date.timezone=PRC
¹ØÓÚXXX£¬´ó½ÄڵؿÉÓõÄÖµÊÇ£ºAsia/Chongqing £¬Asia/Shanghai £¬Asia/Urumqi £¬PRC£¨ÒÀ´ÎΪÖØÇ죬ÉϺ££¬ÎÚ³ľÆ룬ÖлªÈËÃñ¹²ºÍ¹ú£©
¸Ų̂µØÇø¿ÉÓãºAsia/Macao £¬Asia/Hong_Kong £¬Asia/Taipei £¨ÒÀ´ÎΪ°ÄÃÅ£¬Ïã¸Û£¬Ì¨±±£©
»¹ÓÐмÓÆ£ºAsia/Singapore
ÆäËü£ºEtc/GMT-8 £¬Singapore £¬Hongkong
·½·¨Èý£ºecho date("Y-m-d H:i:s", time()+8*60*60);
¸½£ºdateʱ¼ä¸ñʽ
date("Y-m-d H:i:s"); ÏÔʾµÄ¸ñʽ: Äê-ÔÂ-ÈÕ Ð¡Ê±:·ÖÖÓ:Ãë
Ïà¹Øʱ¼ä²ÎÊý:
a - "am" »òÊÇ "pm"
A - "AM" »òÊÇ "PM"
d - ¼¸ÈÕ£¬¶þλÊý×Ö£¬Èô²»×ã¶þλÔòÇ°Ãæ²¹Áã; Èç: "01" ÖÁ "31"
D - ÐÇÆÚ¼¸£¬Èý¸öÓ¢ÎÄ×Öĸ; Èç: "Fri"
F - Ô·ݣ¬Ó¢ÎÄÈ«Ãû; Èç: "January"
h - 12 СʱÖƵÄСʱ; Èç: "01" ÖÁ "12"
H - 24 СʱÖƵÄСʱ; Èç: "00" ÖÁ "23"
g - 12 СʱÖƵÄСʱ£¬²»×ã¶þλ²»²¹Áã; Èç: "1" ÖÁ 12"
G - 24 СʱÖƵÄСʱ£¬²»×ã¶þλ²»²¹Áã; Èç: "0" ÖÁ "23"
i - ·ÖÖÓ; Èç: "00" ÖÁ "59"
j - ¼¸ÈÕ£¬¶þλÊý×Ö£¬Èô²»×ã¶þλ²»²¹Áã; Èç: "1" ÖÁ "31"
l - ÐÇÆÚ¼¸£¬Ó¢ÎÄÈ«Ãû; Èç: "Friday"
m - Ô·ݣ¬¶þλÊý×Ö£¬Èô²»×ã¶þλÔòÔÚÇ°Ãæ²¹Áã; Èç: "01" ÖÁ "12"
n - Ô·ݣ¬¶þλÊý×Ö£¬Èô²»×ã¶þλÔò²»²¹Áã; Èç: "1" ÖÁ "12"
M - Ô·ݣ¬Èý¸öÓ¢ÎÄ×Öĸ; Èç: "Jan"
s - Ãë; Èç: "00" ÖÁ "59"
S - ×Öβ¼ÓÓ¢ÎÄÐòÊý£¬¶þ¸öÓ¢ÎÄ×Öĸ; Èç: "th"£¬"nd"
t - Ö¸¶¨Ô·ݵÄÌìÊý; Èç: "28" ÖÁ "31"
U - ×ÜÃëÊý
w - Êý×ÖÐ͵ÄÐÇÆÚ¼¸£¬Èç: "0&quo
Ïà¹ØÎĵµ£º
phpÁ¬½Ómysql²âÊÔ´úÂ룺
$link=mysql_connect('localhost','root','123456');
if(!$link) echo "ʧ°Ü!";
else echo "³É¹¦!";
mysql_close();
?>
ÔËÐдúÂë³öÏÖ£ºCall to undefined function 'mysql_connect()'… ʧ°Ü
°Ù¶ÈÕÒµ½½á¹ûÊÇPHP+MYSQL »·¾³Ã ......
ÉèÖÃÊý¾Ý¿âÁ¬½Ó
<?php
/**
* @author [˹ÈË]
* @date 2010/6/1/10:16
* @
*
*/
define("RDFAPI_INCLUDE_DIR", "E:/siren/rdfapi-php/api/");
include(RDFAPI_INCLUDE_DIR . "RDFAPI.php");
//Á¬½Óµ½MSAccessÊý¾Ý¿â£¨rdf_db DSN£©µÄʹÓÃÁ¬½ÓÉèÖÃ
......
/ ok
header('HTTP/1.1 200 OK');
//ÉèÖÃÒ»¸ö404Í·:
header('HTTP/1.1 404 Not Found');
//ÉèÖõØÖ·±»ÓÀ¾ÃµÄÖض¨Ïò
header('HTTP/1.1 301 Moved Permanently');
//תµ½Ò»¸öеØÖ·
header('Location: http://www.example.org/'
);
//ÎļþÑÓ³ÙתÏò:
header('Refresh: 10; url=http://www.example.org/');
print 'Y ......
³ÌÐò´úÂë
<!--p
if(isset($_POST['md5'])){ //ÅжÏ$md5ÊÇ·ñÒÑÉèÖã¬Èç¹ûÉèÖÃÁËÔòÖ´ÐÐÒÔÏ´úÂë¡£
if(!is_numeric($_POST['time'])){ //Èç¹ûû»ñÈ¡µ½timeµÄÖµÔò½«timeµÄÖµÉèÖÃΪ30
$_POST['time'] = 30;
}
set_time_limit($_P ......
ÎÒÔÚÉÏһƪÎÄÕÂÖн²µ½Ê¹ÓÃjavascript×ö¼¯³É±íµ¥ÑéÖ¤µÄ·½·¨£¬¶ÔÓÚ¿Í»§¶ËÑéÖ¤ÒѾ×ã¹»£¬µ«ºÃµÄ±íµ¥Ñé֤ӦͬʱÔÚ¿Í»§¶ËºÍ·þÎñÆ÷¶Ë½øÐЗ—ÕâÕýÊÇд±¾ÎĵÄÄ¿µÄ¡£
Èç¹û²ÉÓÃÒ»°ãµÄÑéÖ¤·½·¨Ó¦¸ÃÔõÑùдÄØ£¿
if ($_POST['some'] ²»Âú×ã condition) {
& ......