How to find number of days between two dates using PHP?
If you're using PHP 5.3 >, this is by far the most accurate way of calculating the difference:
PHP 5.3 >
$earlier = new DateTime("2010-07-06"); $later = new DateTime("2010-07-09"); $diff = $later->diff($earlier)->format("%a");