Re: if question

From: Date: Tue, 17 Dec 2002 13:32:31 +0000
Subject: Re: if question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-128552@lists.php.net to get a copy of this message
Oooops -- forgot to mention -- you might want AND not OR or ||... and some other posts have hinted that OR does work... Justin on 18/12/02 12:30 AM, Justin French (justin@indent.com.au) wrote: > Not sure if 'OR' works... I use a double pipe/vertical bar ('||') for > 'OR' > > <? > $stelle_who = '4'; > if(($stelle_who != '1') || ($stelle_who != '2') || ($stelle_who != > '3') || > ($stelle_who != '5')) { > echo "success"; > } > ?> > > Jus to point out the really obvious... in the above example, the following > would also work: > > <? > $stelle_who = '4'; > if($stelle_who == '4') { > echo "success"; > } > ?> > > > Cheers, > > Justin > > > on 18/12/02 12:04 AM, John Fishworld (john@webital.de) wrote: > >> Help ! >> >> Can anyone tell me why this doesn't seem to work ?? >> >> if (($stelle_who != '1') OR ($stelle_who != '2') OR ($stelle_who != >> '3') OR >> ($stelle_who != '5') ) { >> >> and what can i use as an alternative syntex ?? >> >> thanks in advance >> >> > > Justin French > -------------------- > http://Indent.com.au > Web Development & > Graphic Design > -------------------- > Justin French -------------------- http://Indent.com.au Web Development & Graphic Design --------------------

« previous php.general (#128552) next »