PHP day of week numeric to day of week text

前端 未结 7 653
不思量自难忘°
不思量自难忘° 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:20

    It's not popular, but there's actually a function jddayofweek for this in PHP. You can call it with the second parameter as 1 to get full gregorian week day name or 2 for the abbreviated name.

    e.g. jddayofweek(2, 2); #returns Wed
    

    Note that for this function, numbers start at Monday. So Monday=0, Tuesday=1, ...

提交回复
热议问题