RE: [PHP] switch statemnts.
| From: | Boget, Chris | Date: | Wed, 12 Jul 2000 17:07:34 +0000 |
| Subject: | RE: [PHP] switch statemnts. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-6186@lists.php.net to get a copy of this message | ||
> Can I do someting like this?
> switch($v){
> case <=0:
> stuff;
> case 0:
> stuff;
> case >=0:
> stuff
> default;
> }
I don't think you can do the above, but I'm sure if
it is possible, someone will come after me and say
how.
> and this
> switch($v){
> case 1 or 2 or 3 or 4:
> stuff;
> case 5,6,7,8:
> stuff;
> default;
> }
switch( $v ) {
case 1:
case 2:
case 3:
case 4:
stuff
break();
case 5:
case 6:
case 7:
case 8:
other stuff
break();
default:
that stuff
break();
}
Chris