Source Code : User-Defined Function to Determine a Leap Year

PHP Is Open Source Programming Language You Can Download and use It, You required xampp server and wamp server . You download From xampp server from https://www.apachefriends.org/download.html. Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://php.net/. Click Here or search from google with Libraries Name you get jar file related it and also http://php.net/ is a official site

User-Defined Function to Determine a Leap Year

 
<?php

    function is_leapyear($year = 2004) {

        $is_leap = (!($year % 4) && (($year % 100) || !($year % 400)));
        return $is_leap;

    }

    $answer = is_leapyear(2000);

    if($answer) {

        echo "2000 is a leap year<BR>";

    } else {

        echo "2000 is not a leap year.<BR>";

    }

    $answer = is_leapyear(); 

    if($answer) {

        echo "2003 is a leap year.<BR>";

    } else {

        echo "2003 is not a leap year.<BR>";

    }

?>
  
  

Thank with us