PHP获取当前日期的星期

寻技术 PHP编程 / R语言 2023年07月08日 247
$weekarray=array("日","一","二","三","四","五","六"); //先定义一个数组

今天是 <?=date("m-d")?> 星期<?=$weekarray[date("w",time())]?>


function get_week($a){
    $weekarray=array("日","一","二","三","四","五","六");
    return "星期".$weekarray[date("w",strtotime($a))];
}


关闭

用微信“扫一扫”