<?$weekarray=array("日","一","二","三","四","五","六");$windex = date("N",'2016-03-18 17:30:01');$ww = $weekarray[$windex];echo $ww;$windex = date("N",'2016-03-19 17:30:01');$ww = $weekarray[$windex];echo $ww;$windex = date("N",'2016-03-20 17:30:01');$ww = $weekarray[$windex];echo $ww;$weekarray=array("日","一","二","三","四","五","六");echo "星期".$weekarray[date("w","2011-11-12")];
PHP Version 5.5.9
$windex = date("N", '2016-03-18 17:30:01');
PHP 5.5.9 的 date 能接受这样的参数吗?
不需要 strtotime 转换?
'1970-01-01 就是星期四,您可以去查一下万年历
date("N") 得到的范围是 1~7,星期日为 7
date("w") 得到的范围是 0~6,星期日为 0