write code to find the date difference b/w two given date
using PHP not MYSQL function?

Answers were Sorted based on User's Feedback



write code to find the date difference b/w two given date using PHP not MYSQL function?..

Answer / vipul dalwala

$noofdays = ceil(((strtotime($endDate) - strtotime
($startDate)) / (60*60*24)))

Is This Answer Correct ?    13 Yes 2 No

write code to find the date difference b/w two given date using PHP not MYSQL function?..

Answer / rajan

$a= gregoriantojd(1,30,2009);
$b= gregoriantojd(1,5,2009);
echo $a-$b;

Is This Answer Correct ?    6 Yes 1 No

write code to find the date difference b/w two given date using PHP not MYSQL function?..

Answer / rameshfromind

There is one function for gregoriantojd that means convert
to gregorian calendar date to julian date count.

Below the example for counting days between two date.

<?
$startDate = '01-01-2008' // mm-dd-yyyy/yy
$endDate = '01-30-2008' // mm-dd-yyyy/yy
echo gregoriantojd($endDate) - $gregoriantojd($startDate);
?

// OUTPUT

29

Is This Answer Correct ?    9 Yes 9 No

Post New Answer

More PHP Interview Questions

Explain me what are the 3 scope levels available in php and how would you define them?

0 Answers  


am fresher in php ..am finished my linux,apache,mysql,and php(LAMP) course please can any one tell openings for freshers in php ...And please tell how much i demand as a fresher in PHP field just say approximately or assumption ..? at present am staying in chennai am looking my job in chennai only or else in bangalore ... hello experts please answer this question ?

2 Answers   HCL,


Which php framework is best for web development?

0 Answers  


What is use of preg_replace in php?

0 Answers  


how to convert PHP code in to java code

4 Answers  






How to connect to mysql from a php script?

0 Answers  


How easy is php?

0 Answers  


What is the difference between md5(), crc32() and sha1() crypto on php?

0 Answers  


Does php have future?

0 Answers  


Difference between array_combine and array_merge?

0 Answers  


PHP can be used frontend of for backend?

3 Answers   Global Logic,


How many types of inheritances used in php and how we achieve it.

0 Answers  


Categories