Function to determine if periods are overlap

9. jūlijs, 2022
PHP
function isPeriodsOverlap($from1, $till1, $from2, $till2) {
    return (($from1 >= $from2) && ($from1 < $till2)) || (($from2 >= $from1) && ($till1 > $from2))
}