| 1 comments ]


<?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

അനൂപ് അമ്പലപ്പുഴ said... @ Tuesday, May 19, 2009 at 5:30:00 AM GMT+1

:-)

Post a Comment

Please put your comments here. your questions, your suggestions, also what went wrong with me.