how to get time difference between two dates in php code example
Example 1: get hours difference between two dates in php
$hourdiff = round((strtotime($time1) - strtotime($time2))/3600, 1);
Example 2: php get date between two dates
$period = new DatePeriod(
new DateTime('2010-10-01'),
new DateInterval('P1D'),
new DateTime('2010-10-05')
);
//Which should get you an array with DateTime objects.
//To iterate
foreach ($period as $key => $value) {
//$value->format('Y-m-d')
}