PHP day of week numeric to day of week text

前端 未结 7 652
不思量自难忘°
不思量自难忘° 2020-12-01 11:33

This may be really easy but I can\'t find a PHP function to do this...

OK so

$dow_numeric = date(\'w\');

gives the numeric day of t

7条回答
  •  悲&欢浪女
    2020-12-01 12:13

    This should work:

    $dow_numeric = 3;
    
    $last_sunday = strtotime('last Sunday');
    $dow_text = date('D', strtotime('+'.$dow_numeric.' day', $last_sunday));
    

提交回复
热议问题