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 use of count() function in php?
What is repository in php?
Tell me whether it is possible to share a single instance of a memcache between multiple php projects?
How to use http headers inside php?
What is url encoding and decoding in php?
How to concatenate two strings in php?
How can you submit a form without a submit button?
Is php a programming language?
What are the advantages of php mysql?
What is a query in a database?
How to create an array in php?
Why php 7 is faster?
What is data structure in php?
What is == and === in php?
What are escaping characters? Explain with an example?