RE: [PHP-WIN] simple: if ( '$foo = more that one expression ) { }
| From: | Andreas Lange | Date: | Thu, 24 Aug 2000 10:55:47 +0000 |
| Subject: | RE: [PHP-WIN] simple: if ( '$foo = more that one expression ) { } | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-2091@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Asendorf, John [mailto:JAsendorf@lcounty.com]
> Sent: Wednesday, August 23, 2000 1:59 PM
> To: php-windows@lists.php.net
> Subject: [PHP-WIN] simple: if ( '$foo = more that one expression ) { }
>
>
> I need to know if there is a way to is a way to compare a variable against
> more than one condition...
>
>
> if ( $foo = "north" OR "south" OR "west" OR "mount" ) {
> }
>
> is there a way to do this? Or could I compare the variable against a
> simple array of values looking for a match?
>
> I want to do this so that I can check all the possible things I'm looking
> for with one if statement then check each one specifically if any of them
> show up...
>
> Any help?
this is an alternative method (no if). I think this one was faster than ereg
switch ($foo)
{
case "north":
case "south":
case "west":
case "mount":
$go.=$dosomething;
break;
}
Try this at home =8:)
CodeDuck