[snip]
The cleanest looking multiple "if" scenario is to use a "Switch" statement.
Unfortunately I don't believe PHP's "switch" will do varied conditions, only equality
statements:
$j = 5;
switch ($j) {
case "< 6":
echo "first";
break;
case <6:
echo "second";
break;
case 5:
echo "third";
break;
default:
echo "fourth";
break;
}
[/snip]
Hmmm, what about this...seems to work fine....
$j = 7;
switch($j){
case $j < 6:
echo $j . " is less than 6\n";
break;
}
Alter the value of $j to see the results, the above example forgets to compare $j in
each case.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php