PHP Classes
elePHPant
Icontem

File: LeapYearChecker.class.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Ellery Leung  >  Leap year checker  >  LeapYearChecker.class.php  >  Download  
File: LeapYearChecker.class.php
Role: Class source
Content type: text/plain
Description: Leap Year Checker main file
Class: Leap year checker
Check whether a given year is a leap year
Author: By
Last change:
Date: 8 years ago
Size: 311 bytes
 

Contents

Class file image Download
<?php
class LeapYearChecker{
    function
isLeapYear($year){
        if((
$year % 400) == 0){
            return
true; //Is LeapYear
       
}else if(($year % 100) == 0){
            return
false; //Not a LeapYear
       
}else if(($year % 4) == 0){
            return
true; //Is LeapYear
       
}else{
            return
false; //Not LeapYear
       
}
    }
}
?>