RosettaCodeData/Task/Leap-year/PHP/leap-year-1.php

8 lines
135 B
PHP
Raw Permalink Normal View History

2013-04-10 21:29:02 -07:00
<?php
2015-02-20 00:35:01 -05:00
function isLeapYear($year) {
if ($year % 100 == 0) {
return ($year % 400 == 0);
2013-04-10 21:29:02 -07:00
}
2015-02-20 00:35:01 -05:00
return ($year % 4 == 0);
2013-04-10 21:29:02 -07:00
}