This will loop through the years, but it is even easier after you find a leap year because the next one will be 4 years after, etc.
$date_from = strtotime('2007-06-01');
$date_to = strtotime('2013-05-30');
for($year=$date_from; $year<=$date_to; $year=strtotime('next year', $year)) {
echo date('Y', $year);
echo date('L', $year) ? 'Leap year' : 'Not leap year';
}
But I think you can just check if the year 'Y'
is evenly divisible by 4.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…