| ||||||
|
How to find out in PHP if this year is a leap year
Here is how you find out if the current year is a leap year with PHP. The code date("L") will either return a 0 if it is not currently a leap year, or a 1 if it does happen to be one. <?php if(date("L") == 0) { echo "This year <i>is not</i> a leap year!"; } else { echo "This year <i>is</i> a leap year!"; } ?>
|