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

What are the features and advantages of object-oriented programming in php?

0 Answers  


Write a query to to delete duplicate rows?

4 Answers   ATS,


Is php dead 2019?

0 Answers  


What are the advantages of oops in php?

0 Answers  


Can you convert php to html?

0 Answers  






What is empty () in php?

0 Answers  


How do I expire a php session after 30 minutes?

0 Answers  


How stop the execution of a php scrip?

0 Answers  


How to Retrieve a Cookie Value?

0 Answers  


What are the differences between GET and POST methods in form submitting?

0 Answers  


What does the unset() function means?

0 Answers  


Where do I run php code?

0 Answers  


Categories