Re: note 16777 added to function.mcal-days-in-month

From: Date: Tue, 13 Nov 2001 14:03:48 +0000
Subject: Re: note 16777 added to function.mcal-days-in-month
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-20790@lists.php.net to get a copy of this message
PHP has at least two built-in functions that return the number of days in a month. Why reinvent the wheel? --zak On November 12, 2001 11:49 pm, dash@dashonit.com wrote: > Returns number of days in a given month. Adjusts for leap year. > > function determine_days_in_month($month, $year) > { > switch ($month) > { > case 1: > $numDays = 31; > break; > case 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) ...

« previous php.notes (#20790) next »