How to get difference between two dates in days in php
<?php$date1 = "2012-01-01"; //Old date
$date2 = "2012-01-10"; //New date
$diff = abs(strtotime($date2) - strtotime($date1));
$days = floor($diff / (24*60*60));
echo $days;
?>
Result: 9
Read 4554 times.