You are here: Re: [PHP] OR statement « PHP « IT news, forums, messages
Re: [PHP] OR statement

Posted by Tom Rogers on 03/25/05 03:48

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация