|
$weekarray=array("日","一","二","三","四","五","六");
echo "星期".$weekarray[date("w",strtotime("2020-11-4"))];输出:
星期三
星期四
date()函数的w格式:使用数字表示星期中的第几天,0(表示星期天)到 6(表示星期六)
php判断今天是星期几
header('content-type:text/html;charset=utf-8');
$weekarray=array("日","一","二","三","四","五","六");
echo "今天是星期".$weekarray[date("w")];
输出:今天是星期四
|
|