php獲取時間是星期幾
阿新 • • 發佈:2020-08-17
PHP星期幾獲取程式碼:
date("l"); //data就可以獲取英文的星期比如Sundaydate("w"); //這個可以獲取數字星期比如123,注意0是星期日
獲取中文星期幾:
$weekarray=array("日","一","二","三","四","五","六"); //先定義一個數組echo "星期".$weekarray[date("w")];
獲取指定日期是:
$weekarray=array("日","一","二","三","四","五","六");echo "星期".$weekarray[date("w",strtotime("2011-11-11"))]; 學習如逆水行舟,不進則退. (說不定我的目的地是在下游呢.) 轉載:
$time = date('Y-m-d',strtotime(Db::name('wx_order')->where('id',$v)->value('create_time'))); // dump($time); $weekarray=array("日","一","二","三","四","五","六"); $time_show = $time." "."周".$weekarray[date("w",strtotime($time))];