Re: OR statement
| From: | Tom Rogers | Date: | Fri, 25 Mar 2005 01:48:28 +0000 |
| Subject: | Re: OR statement | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-211538@lists.php.net to get a copy of this message | ||
Hi,
Friday, March 25, 2005, 11:27:30 AM, you wrote:
MD> Hello,
MD> I would like to first thank everyone for their help with the last few
MD> questions I have had. I really appreciate it.
MD> Here is my question:
MD> if ($audio == "Cool"){
MD> Do this
MD> }else{
MD> Do that
MD> }
MD> This work fine, however, I would like to add to the criteria above. I would
MD> like to say:
MD> if ($audio == "Cool" or "junk" or "funky"){
MD> ...
MD> I have tried to look for something in the manual, and am still looking, but
MD> a little help on this would be appreciated.
MD> Thank you again,
MD> --
MD> Steve Marquez
The most easily expandable way is with a switch statement
switch($audio){
case 'Cool':
case 'junk':
case 'funky':
Do this....
break;
default:
Do that....
break;
}
--
regards,
Tom