In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] says...
> yeah, i really like using cases they work well and especially if you want to
> do something different for different values, i forgot about that, its a good
> way to do it,
>
> does php have case else? cuz that is a really handy thing in VB that people
> often forget...
You mean 'default'
switch ($var) {
case 'TEST-1': case 'TEST-2': case 'TEST-2':
do_something();
break; // to stop falling through to next option
default: // any other case not above
do_other_thing();
break; //Not really needed as is last statement but good practice
}
And default can appear anywhere in the statement, not just as last item.
Cheers
--
Quod subigo farinam
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php