PHP program to check if a given year is Leap year or not
Below is the PHP script to find the given year is leap year or not.
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<h2>PHP script to find given year is a leap year or not </h2>
<form action="" method="POST">
<input type="number" name="year" />
<input type="submit" />
echo "String not allowed.
Input should be a number";
if(($year % 4==0) and ($year % 100!=0) or ($year % 400==0))
echo "$year is a leap year";
echo "$year is not a leap year";
Latest PostsWrite a PHP program that will compare two strings whether they are same or not. Write a PHP program to print first 10 Fibonacci numbers Write a PHP program to make the sum of first 100 odd numbers PHP program to check if a given number is ODD or EVEN PHP program to check if a given year is Leap year or not
© Copyright - 2018 - 2021 | All rights reserved at Funda of Web IT