date - how to format an integer into the name of a weekday in php -


this question has answer here:

is there way use datetime::createfromformat convert 0-6 integer name of day of week?

i creating calendar script , let users customize way days of week display (mon vs monday) using array of week day names not desirable.

how can use createfromformat this?

hope understand question.

$day = 0;    $date = datetime::createfromformat('j-m-y', $day . '-feb-2010'); echo $date->format('l'); 

would output :

sunday