I'm looking for a way to compare two lapses of time.
If the second lapse or part of it is in the first one -> return false.
Although, if the first one or a part of it is in the second one -> return false too.
I feel like I didn't have to skive math lessons...
// first lapse
$a = strtotime('2016/05/04 22:50');
$b = strtotime('2016/05/20 22:15');
// second lapse
$y = strtotime('2016-05-12 12:00');
$z = strtotime('2016-05-20 10:00');
if (($y >= $a && $y <= $b) || ($z >= $a && $z <= $b)
|| ($a >= $y && $a <= $z) || ($b >= $y && $b <= $z))
if $a <= $b and $y <= $z, count
min($b, $z) - max($a, $y) if < 0 - no overlap = 0 - common boundary point > 0 - overlap