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
Which will check if a function exists?
Why php is used with mysql?
What would occur if a fatal error was thrown in your php program?
How to genrate report in wordpress cms
How to avoid the undefined index error?
What are the differences between php constants and variables?
Is multiple inheritance supported in php?
What is the use of session and cookies in php?
What is the difference between html and php?
How to return ascii value of character in php?
What is print_r?
Explain the syntax for ‘foreach’ loop with example.
What is php7?
What is isset post?
How to remove leading and trailing spaces from user input values?