Re: multiple variables

From: Date: Fri, 15 Mar 2002 15:05:34 +0000
Subject: Re: multiple variables
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-88656@lists.php.net to get a copy of this message
or use something like this: $array_values = array(1,2,3,4); if (in_array(user($arbitraryVariable), $array_values)) { // do your stuff } Greets, Edward ----- Original Message ----- From: "Christoph Starkmann" <kiko@nfq.de> To: <php-general@lists.php.net> Sent: Friday, March 15, 2002 4:11 PM Subject: RE: [PHP] multiple variables > Hi! > > > if(user($arbitraryVariable)==(1 or 2 or 3 or 4)) > > What would be the proper syntax for this? > > Here: > > if((user($arbitraryVariable) >= 1) and ($arbitraryVariable <= 4) and > ($arbitraryVariable == round($arbitraryVariable))) > > In other cases, you'd have to write > > if((user($arbitraryVariable)==1) or (user($arbitraryVariable)==2) or (...)) > > Cheers, > > Kiko > > ----- > It's not a bug, it's a feature. > christoph starkmann > mailto:kiko@nfq.de > http://www.fh-augsburg.de/~kiko > ICQ: 100601600 > ----- > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#88656) next »