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


Please Help Members By Posting Answers For Below Questions

What is the use of count() function in php?

524


What is repository in php?

524


Tell me whether it is possible to share a single instance of a memcache between multiple php projects?

537


How to use http headers inside php?

561


What is url encoding and decoding in php?

552






How to concatenate two strings in php?

530


How can you submit a form without a submit button?

527


Is php a programming language?

546


What are the advantages of php mysql?

515


What is a query in a database?

531


How to create an array in php?

545


Why php 7 is faster?

504


What is data structure in php?

499


What is == and === in php?

501


What are escaping characters? Explain with an example?

511