php - Getting Day name from day of week -



php - Getting Day name from day of week -

i have 7 records in mysql database each corresponsing day of week 0-6

now php script want display instead of 0, 'sunday' or instead of 1 show 'monday'.

is there function available takes numeric days of week , returns name of week day?

you utilize date function, format l:

l (lowercase 'l')

a total textual representation of day of week

http://php.net/manual/en/function.date.php

and utilize fact sunday 0:

echo date('l', strtotime("sunday +{$day_number} days"));

or function:

function getdaynamefromdaynumber($day_number) { homecoming date('l', strtotime("sunday +{$day_number} days")); }

php cakephp

Comments

Popular posts from this blog

maven fortify plugin : Unable to load build session with ID XXXXX .. See log file for more details -

c# - Primavera WebServices does not return any data -

android - Display emoji panel with genymotion - keyboard/touch input? -