/ Published in: PHP
This function takes a start time, an end time, and an interval ("step size"). It returns an array of times separated by that interval between the start time and end time (similar to what Google Calendar does). The keys of the array are the number of seconds between their times and the start time.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
static public function timeIntervals($start_time, $end_time, $interval) { $interval = $interval * 60; for ($i = $start_formatted; $i < ($end_formatted); $i += $interval) { } return $times; }