Re: multiple variables
| From: | mnc at stoic dot net | Date: | Fri, 15 Mar 2002 20:49:21 +0000 |
| Subject: | Re: multiple variables | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-88705@lists.php.net to get a copy of this message | ||
On Fri, 15 Mar 2002, Ralph Jarvis wrote:
> An obvious question for some, but I am stumped:
> I want to use multiple optins in an "if" statement...
> if(user($arbitraryVariable)==(1 or 2 or 3 or 4))
> What would be the proper syntax for this?
Sometimes I find a switch to be the most efficient (and least typing)
approach:
switch(user($arbitraryVariable))
{
case 1:
case 2:
case 3:
case 4:
do whatever
break;
default:
do the other thing
}
miguel