I'm using while to print events on certain date with eventID, start and end time.
How can I check and print which event time overlaps with which using PHP?
<?php
while (list($key, $event_row) = each($events)) {
$times_array = array(
$event_row[0],
date('Y-m-d H:i:s', $event_row[1]),
date('Y-m-d H:i:s', $event_row[2])
);
print_r($times_array);
}
Array ( [0] => 11 [0] => 2015-05-29 19:00:00 [1] => 2015-05-29 21:00:00 )
Array ( [0] => 13 [0] => 2015-05-29 19:00:00 [1] => 2015-05-29 21:00:00 )
Array ( [0] => 16 [0] => 2015-05-29 21:00:00 [1] => 2015-05-29 22:00:00 )
Example output I would like is:
Event ID#: 11 overlaps with Event ID# 13.
Event ID#: 13 overlaps with Event ID# 11.
Event ID#: 16 doesn't overlap.