While comparing the values in the below array
array
0 =>
array
0 => string '09:30' (length=5)
1 => string '11:00' (length=7)
1 =>
array
0 => string '11:01' (length=5)
1 => string '18:00' (length=7)
2 =>
array
0 => string '12:05' (length=5)
1 => string '14:00' (length=7)
3 =>
array
0 => string '14:00' (length=5)
1 => string '20:20' (length=7)
If I am using if($a > $b)
it is even giving true for equal values ($a = $b) // this is not comparision
,
while
if($a - $b > 0)
is giving accurate result.
Why so ?
EDIT: The code part where I am using cmp.
This woks fine
for($i=0; $i < $fr -1 ; $i++)
{
if( $dtime[$i][1] - $dtime[$i+1][0] > 0 )
{
echo 'It is clashing';
break;
}
}
This does not works fine
for($i=0; $i < $fr -1 ; $i++)
{
if( $dtime[$i][1] > $dtime[$i+1][0] )
{
echo 'It is clashing';
break;
}
}