On Tue, 26 Jun 2001 00:28, Tyler Longren wrote:
> Hello,
>
> I have something like this:
> $Month = "6";
> $Year = "2001";
> $Date = "1";
>
> Is there any relatively simple way to get the day out of that? For
> example, the day for 6-1-2001 would be Friday.
>
> Thanks,
> Tyler
If that info comes from a database, the db might have date formatting
capabilities that you could use.
Otherwise, mktime and date would do:
$dayofweek = date("l", mktime(0,0,0,$Month, $Date, $Year))
Or you could use getdate instead of date to populate an array of
interesting values :-)
Have a look at the date functions for more exciting possibilities.
--
David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
Birds are trapped by their feet, people by their tongues.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]