Re: The || Operator
| From: | zavaboy | Date: | Sat, 24 May 2003 17:27:10 +0000 |
| Subject: | Re: The || Operator | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-148852@lists.php.net to get a copy of this message | ||
Ok,
Thanks!
"Tom Rogers" <trogers@kwikin.com> wrote in message
news:457731279.20030525032546@kwikin.com...
> Hi,
>
> Sunday, May 25, 2003, 3:18:37 AM, you wrote:
> z> $you = "some";
> z> if ($you == ("few" || "some" || "one")) {
> z> echo "yes";
> z> }else{
> z> echo "no";
> z> }
>
> z> How can I make it print out "yes" if $you is equal to "few",
> z> "some", or
> z> "one"?
>
> you can use a switch statement
>
> switch($you){
> case 'few':
> case 'some':
> case 'one':
> echo 'yes';
> break;
> default:
> echo 'no';
> break;
> }
>
> --
> regards,
> Tom
>