|
Posted by Curtis on 11/27/06 10:39
laredotornado@zipmail.com wrote:
> Hi,
>
> I'm using PHP 4.4.4 and I was wondering if anyone knows of a function
> or quick way, given a scalar representation of month (as a number
> between 1 and 12), day, and year (as a four digit number, e.g. 2007),
> how would I tell if that day is a Saturday?
>
> Thanks, - Dave
Or, you could try using strtotime to get the timestamp:
<?php
# if the month, day, and year aren't already in a single scalar, put
them in one
$date = "${month}/${day}/${year}";
$dayOfWeek = date('l', strtotime($date));
?>
Navigation:
[Reply to this message]
|