Why not run the code for leap years?
phpcn_u54510
phpcn_u54510 2017-11-07 14:39:38
0
1
1323

<form action="abc.php" method="post">

<input type="text" name="nianfen"/>

<input type="submit" name="Submit"/>

</form>

< ;?php


$n = $_POST['nianfen'];

if($n<0||! is_numeric($n)){

echo 'Please enter the correct year';

exit;

}

if($n.'%'.'400'==0){

echo 'leap year';

exit;

}

if($n.'%'.'4'==0&&(!($n.'%'.'100' ==0))){

echo 'leap year';

exit;

}

else{

echo '平年';

exit;

}














#?>

phpcn_u54510
phpcn_u54510

reply all(1)
卿立平

<?php

$year = $_GET['year'];

//Determine whether the entered year is a numerical value

if(!is_numeric($year)){

echo 'Please enter the numeric type';

}

//If it is a numeric value, Just determine whether it is a leap year or a normal year

if($year%100==0){

if($year%400==0 && $year%3200!=0){

echo "century year" . $year . "is a leap year";

}else{

echo "century year" . $year . "is a normal year" ;

}

}else{

if($year%4==0 && $year%100!=0){

echo "Ordinary year" . $year . "It is a leap year";

}else{

echo "It is an ordinary year" .$year . "It is an ordinary year";

}

}

?>


Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template