Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



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

Answer / palanisamy

we have to use the argument 'L' for the date function and it
will return 1 if the given year is leap year else it will
return 0

ex: date('L',$yourdate)

Is This Answer Correct ?    8 Yes 2 No

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

Answer / krishna reddy ketha

NOTE:
IT IS ONLY FOR FIND OUT THE GIVEN YEAR IS
LEAP YEAR OR NOT.

CONDITION:
/*
leap year:

// is divisible by 4 and not by 100
// is divisible by 400
*/


if((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)

printf("%d is a LEAP YEAR" + year);
else
printf("%d is NOT a LEAP YEAR" + year);

Is This Answer Correct ?    5 Yes 0 No

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

Answer / kalpana

4

Is This Answer Correct ?    5 Yes 1 No

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

Answer / 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

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

Answer / 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

More PHP Interview Questions

What is a helper function?

0 Answers  


Why do we use javascript in php?

0 Answers  


hi guys..i m new to php..and want to learn it including the oops concept...can anybody send me some good programming bases exercise or a small learning project on it at nitsl_a@yahoo.co.in.I know html and going thru some of its websites.But about to go on it practically.plz advice.

1 Answers   College School Exams Tests, Satas, Wipro,


What exactly is PHP?

0 Answers  


What is the use of print_r function in php?

0 Answers  


How can we encrypt the password using php?

0 Answers  


What is the difference between $name and $$name?

0 Answers  


full form of php??

12 Answers   HCL,


How can we get the browser properties using PHP?

4 Answers   Google, Pollux Softech,


How does header() work . What do they tell the server same question for SESSIONS

2 Answers   Yahoo,


How is the comparison of objects done in php?

0 Answers  


how to set session expire(session timeout) using php code

2 Answers  


Categories