<?php
// function to check whether the year given is a leap year or not
function checkLeapYear($year){
// Is the year a leap year?
if ($year % 400 == 0 OR ($year % 4 == 0 AND $year % 100 != 0))
{
return true;
}
else{
return false;
}
}
$a = 2003;
if(checkLeapYear($a)){
echo "Leap Year";
}
else{
echo "Not a leap Year";
}
?>
enjoy PHPing
1 comments
:-)
Post a Comment
Please put your comments here. your questions, your suggestions, also what went wrong with me.