How can we know the number of days between two given dates
using PHP?

Answer Posted / 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 ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why triggers are used in mysql?

534


Where are the persistent cookies stored on your computer?

575


How to get the http request in php?

578


What is artisan in php?

505


Why would we use === instead of ==?

8355






What is a php web application?

505


How can we determine whether a variable is set?

529


How to get the total number of values in an array?

523


What is the difference between single-quoted and double-quoted strings in php?

545


Can php replace javascript?

535


What is __ invoke in php?

464


How to get a total number of elements used in the array?

508


How to take a substring from a given string in php?

520


Does apache use php?

542


Explain how to submit form without a submit button.

545