[php] Finding day of week

Hey all!

How do I find the day of the week of a certain date?

Thanks

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


<?php
 
// Prints: Friday
echo date("l", mktime(0, 0, 0, 9, 10, 2004));
?>

Can I have a result of an integer instead of “Friday” or “Tuesday”? Anything like that? I don’t really want an array/function of stuff that turns “friday” into 5.

sure, just use a switch.

http://us2.php.net/manual/en/control-structures.switch.php

chris


$weekday = getdate(mktime(0, 0, 0, 9, 10, 2004))["wday"];

0 is sunday, 1 is monday and so on.