Is there a way to easily tell PHP how many days there are in a selected
month without writing the following out for each month:
if($Month == "January") {
$NumberOfDays = 31;
}
elseif($Month == "February") {
if($Year == "A Leap Year") {
$NumberOfDays = 29;
}
elseif($Year != "A Leap Year") {
$NumberOfDays = 28;
}
}
elseif($Month == "March") {
$NumberOfDays = 31;
}
............and so on, and so on, and so on
I would greatly appreciate any help. Thanks.
Ben:
Try:
$totaldays = date('t',mktime(0,0,0,$month,1,$year));
Works for me.
tedd
--
--------------------------------------------------------------------------------
http://sperling.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php