Hello,
I have a calendar, and the user can click on a day of the month, which is passed to a form. I need a way to get the day of the week (i.e. Fri) from the day of the month (i.e. 24th). I can get the current day of the week, but cant seem to find a function that allows me to correspond it to the day of the month.
Thanks!
Gettting day of the week from day of the month
Moderator: General Moderators
getdate() and date() know about it
Code: Select all
<?php
$ts = mktime( 12, 0, 0 , 8 , 25, 2003);
echo date('F j, Y \w\a\s \a l (D)', $ts); // only the l and D parameter matter here
$d = getdate($ts);
echo ' / ', $d['weekday'], ' / ', $d['wday'];
?>