Re: OR statement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux