I have the following variables:
$start_t = 1;
$start_n = 2;
$end_t = 6;
$end_n = 5;
I want to check all the logical combinations between the $start_t and $start_n AND $end_t and $end_n.
I have the following:
if($start_t >= $start_n && $end_t >= end_n)
{ // Do stuff }
elseif($start_t < $start_n && $end_t >= $end_n)
{ // Do stuff }
elseif($start_t >= $start_n && $end_t < $end_n)
{ // Do stuff }
elseif($start_t < start_n && $end_t < $end_n)
{ // Do stuff }
Is there any other combination that I cannot see? I mean between the $start_t, $start_n And $end_t and $end_n.
Is there any way to calculate all the available combinations?
The equality case (
$start_t === $start_n, similar for$end_*) is missing. Otherwise, all combinations are there.