Re: switch statemnts.
| From: | Phil Driscoll | Date: | Wed, 12 Jul 2000 17:26:05 +0000 |
| Subject: | Re: switch statemnts. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-6191@lists.php.net to get a copy of this message | ||
This doesn't help with your query, but out of interest, in BBC BASIC on
Acorn Risc OS machines there is a nice trick which can be done with the
switch statement because of the way it is implemented. The PHP equivalent
is:
switch(TRUE)
{
case($v<=0):stuff;
case($v==0):stuff;
default:stuff;
}
It makes for much neater looking code than a load of elsifs.
Cheers
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org