I am using a switch to test the value of a variable.
The variable, $sizeTotal
, could contain either a string or a number. In the below example, I am expecting the switch to trigger the default case.
However, it goes to the first case every time and I don't know why...
$sizeTotal = "test";
$extraCharges['2'] = 1000;
switch ($sizeTotal) {
case ($sizeTotal < $extraCharges['2']):
$var = 40;
return $var;
case ($sizeTotal >= $extraCharges['2']):
$var = 60;
return $var;
default:
$var = 1000;
return $var;
}