Getting the Leap Years in a Specified Time Range with PHP

Source code php leap year <?php / Copyright 木木夕互联网开发 http://www.erik.xyz Developer: 艾瑞可 May 13, 2015 11:50:36 PM PHP */ header(“Content-Type:text/html;Charset=utf-8”); //calculate all leap years between 2000 and 2030 / Analysis: a leap year is a year divisible by 4, so any year that divides by 4 with no remainder is a leap year / $_POST[“sub”]=2000; //start from 2000 if($_POST[“sub”]){ for($a=2000;$a<=2030;$a++){ //define the loop variable if($a%4==0){ //check whether the year is divisible by 4 echo $a.”  ”; } } } ?> Output result