Forum Moderators: coopster
switch (true) {
case ($count < 0):
echo 'less than 0';
break;
case (($count >= 0) && ($count < 5)):
echo 'between 0 (inclusive) and 5';
break;
case ($count >= 5):
echo 'greater than or equal to 5';
}
It's not so much a matter of taking advantage of the benefits of the switch statement, it more about being easy to read - which i find the switch construct does.