note 16078 deleted from function.mcal-is-leap-year by jimw

From: Date: Tue, 16 Oct 2001 00:21:04 +0000
Subject: note 16078 deleted from function.mcal-is-leap-year by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-18952@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'; } }

« previous php.notes (#18952) next »