RE: [PHP-WIN] simple: if ( '$foo = more that one expression ) { }

From: Date: Thu, 24 Aug 2000 12:15:06 +0000
Subject: RE: [PHP-WIN] simple: if ( '$foo = more that one expression ) { }
Groups: php.windows 
Request: Send a blank email to php-windows+get-2093@lists.php.net to get a copy of this message
Thanks everyone... I now have a starting point and a couple of possibilities to explore. It's really weird that there isn't anything like this in the online manual... I don't know if it's just me or does everyone have these types of problems where you can only find a piece of the answer for the question you have when using the manual? --------------------- John Asendorf - jasendorf@lcounty.com Web Applications Developer - http://www.lcounty.com Licking County, Ohio, USA 740-349-3631 > -----Original Message----- > From: Pablo Vera [mailto:pvz@vercan.com] > Sent: Wednesday, August 23, 2000 5:47 PM > To: Asendorf, John > Cc: php-windows@lists.php.net > Subject: Re: [PHP-WIN] simple: if ( '$foo = more that one > expression ) { > } > > > AJ> I need to know if there is a way to compare a variable against > AJ> more than one condition... > > AJ> if ( $foo = "north" OR "south" OR "west" OR > AJ> "mount" ) { } > > John: > > You can do this: > > if (ereg(" $foo "," north south west mount ")) { } > > The spaces before and after $foo are necessary to avoid matching "nor" > or "rth" or some other word that is a part of the ones you are looking > for, ereg will return TRUE if the first string was found inside the > second one, false otherwise. > > Saludos, > Pablo Vera > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net > For additional commands, e-mail: php-windows-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net >

« previous php.windows (#2093) next »