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 the week 0-6 for Sunday to Saturday.
And
$dow_text = date('D');
gives the 3 letter abbreviation for the text day of the week (Sun, Mon, etc.)
Is there a function or easy way to use $dow_numeric
to get $dow_text
? If I have '0' as $dow_numeric
, how can I make $dow_text = 'Sun'
? Yes a switch
statement could do the job, but I’m looking for a more elegant solution.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…