To find out the current year is leap year or not which
date() function we've to use.Give the syntax also
Answer Posted / vaneet badhan
to check the current year code is :
date("L");
output will be 1 coz 2008 is a leap year.
better way to check is :
$year=2008;
echo date("L",mktime(1,1,1,1,1,$year));
now you can check any year by just changing the value of
variable $year, this is called dynamic programming.
| Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
What is the difference between php4 and php5?
What is the difference between associative array and indexed array?
What is php7?
What distinguishes php from something like client side java script?
What is difference between mysql_connect and mysqli_connect?
What is php addslashes?
What is the different between count() and sizeof() in php?
Can we set session value in javascript?
What is difference between ksort() and usort() functions.
Is php better than java?
How to get useful error messages in php?
What are the different types of PHP arrays?
How to fix "headers already sent" error in php
How can you associate a variable with a session?
How can we upload a file in php?