Calculate yeap year or print leap year using program

technical talkiess
0

Calculate yeap year or print leap year using program 



<?php

function isLeapYar($year){

return (date('L',mktime(0,0,0,1,1,$year)) == 1);

}

$year = 1950;

$toyear = 2050;

for($year = $year;$year < $toyear ; $year++){

if(isLeapYar($year)){

echo "Leap Year" . $year . "<br>";

}else{

echo "Leap Not Year " . $year . "<br>";

}

}

?> 

Post a Comment

0Comments

Thanks you for commenting your questions. I will see question and respond you.

Post a Comment (0)