Skip to content
Advertisement

Tag: difference

How to I get a range of times from a start time and end times with an hour difference using PHP?

$course_hour = 1; $starttime = ’07:00′; $endtime = ’16:00′; I wish if it could return an array of values like below: If $return_array = array(’07:00 – 08:00′, ’08:00 – 09:00′, ’09:00 – 10:00′, ’10:00 – 11:00′, ’11:00 – 12:00′, ’12:00 – 13:00′, ’13:00 – 14:00′, ’14:00 – 15:00′, ’15:00 – 16:00′); If $return_array = array(’07:00 – 08:30′, ‘8:30 – 10:00’,

Advertisement