note 16078 added to function.mcal-is-leap-year
| From: | office at at universalmetropolis dot com | Date: | Tue, 16 Oct 2001 00:16:42 +0000 |
| Subject: | note 16078 added to function.mcal-is-leap-year | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-18951@lists.php.net to get a copy of this message | ||
If you don't have the MCAL library as I don't, you can substitute MCAL_IS_LEAP_YEAR with
this easy function. (note this should only be used for calendars within a range of several centuries
as it might not work with years higher than 10,000 AD).
function calendarmonth($month,$year){
// make sure you are comparing February
if($month==2){
// check to see if year is divisible by four
$leapyrchk=$year/4;
$leapyrchk=strlen($leapyrchk);
// if year is divisible by four, it will present a three-digit response
if($leapyrchk==3){
$daysinmonth=29;
$leapyear='yes';
}else{
$daysinmonth=28;
$leapyear='no';
}
}
--
http://www.php.net/manual/en/function.mcal-is-leap-year.php
http://master.php.net/manage/user-notes.php?action=edit+16078
http://master.php.net/manage/user-notes.php?action=delete+16078
http://master.php.net/manage/user-notes.php?action=reject+16078