note 54902 deleted from function.checkdate by bobby
| From: | bobby@php.net | Date: | Thu, 07 Sep 2006 18:54:13 +0000 |
| Subject: | note 54902 deleted from function.checkdate by bobby | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-116867@lists.php.net to get a copy of this message | ||
Note Submitter: martin a pavel
----
<?php
/**
* Number of days in selected Month of selected Year
* @return int
*/
function DaysInMonth ( $Year, $MonthInYear )
{
if ( in_array ( $MonthInYear, array ( 1, 3, 5, 7, 8, 10, 12 ) ) )
return 31;
if ( in_array ( $MonthInYear, array ( 4, 6, 9, 11 ) ) )
return 30;
if ( $MonthInYear == 2 )
return ( checkdate ( 2, 29, $Year ) ) ? 29 : 28;
return false;
}
?>