note 92531 deleted from function.date by danbrown
| From: | danbrown@php.net | Date: | Mon, 20 Jun 2011 14:54:07 +0000 |
| Subject: | note 92531 deleted from function.date by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-180694@lists.php.net to get a copy of this message | ||
Note Submitter: get.mango at gmail.com (Mangesh Sangapu)
----
(Referring to the leap year posts)
Not every year that is divisible by 4 is a leap year. There are other conditions. Here's the
complete list:
1. Every year that is evenly divisible by four is a leap year;
2. of those years, if it can be evenly divided by 100, it is NOT a leap year, unless
3. the year is evenly divisible by 400. Then it is a leap year.
<?php
function is_leapyear($year) {
if ( ($year%4) != 0 )
{ return false; }
if ( ($year%100)==0 )
{
if ( ($year%400) == 0 )
{ return true; }
else
{ return false; }
}
else
{ return true; }
}
?>