To find out the current year is leap year or not which
date() function we've to use.Give the syntax also

Answer Posted / mahesh

$dt = getdate();
$year = $dt['year'];
$month =
$array(1=>31,(($dt['year']-2000)%4?28:29),31,30,31,30,31,31,30,31,30,31);
if array[2]==29
then it is a leap year.
Otherwise Not

Is This Answer Correct ?    0 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

i m a B.E,passed out few yrs bak failed to find good job due to less marks now thinkin of a career as PHP developer. is it a lucarative field and wat r career prospects; hv heard dat initial salary is very less bout 6k also most jobs r contrct jobs.pls guide me need ur valuable advice.pls hellppp!! thnx..

1668


How to download and install php for windows?

546


What are php loops?

531


What is the importance of php?

517


Why is facebook still using php?

571






Tell me how do I escape data before storing it into the database?

521


What are the encryption functions in php?

556


What is user defined function in php?

532


How to convert a string to uppercase in php?

541


Tell me how to find current date and time?

538


Why do we use polymorphism in php?

537


What's the difference between __sleep and __wakeup?

544


What is difference between required and include in php?

472


How would you determine the size of a file in php?

589


List the different types of print functions available in php?

540