PHP7中文手册2018 带注释 最新chm版
function getweek($time) { $time = strtotime($time); $weekarray=array("日","一","二","三","四","五","六"); $week = $weekarray[date('w',$time)]; if($week=='日') { return "周".$weekarray[date('w',$time)].""; } elseif($week=='六') { return "周".$weekarray[date('w',$time)].""; } else { return "周".$weekarray[date('w',$time)]; } } echo getweek('2014-11-26');