RE: [PHP] php in css not working with IF's

From: Date: Thu, 04 Oct 2001 05:42:58 +0000
Subject: RE: [PHP] php in css not working with IF's
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-69886@lists.php.net to get a copy of this message
Thanks for sticking with me here and for your examples!! So basically, I need to use AND instead of OR. if (($site_style!=="10") && ($site_style!=="9") && ($site_style!=="8")) { } elseif ($site_style=="10") { } hrm... it didn't work. Sorry for being such a dope about this.... :( Jason > Ok, you are clearly not following along here... ;) > > You have (let $site_style = A for brevity): > > if( A!=10 OR A!=9 OR A!=8 ) > > When A=10 this becomes: > > if( 10!=10 OR 10!=9 OR 10!=8 ) > false true true > > if( false OR true OR true ) is the same as if (true) > > Seriously, try drawing the Venn diagram for your expression. > > Or try substituting common english. > > if Jason is not 21 or Jason is not 20 or Jason is no 19 let him into the > cool club. > > Say Jason is 21, is he allowed in? Sure he is, because one of the > conditions for getting into the cool club is that Jason is not 20. It > doesn't matter that one of the other conditions says to not let Jason in. > If the people writing the rules wanted to force all the conditions to > apply they would have written: > > if Jason is not 21 AND Jason is not 20 AND Jason is not 19, let him into > the cool club. > > -Rasmus > >

« previous php.general (#69886) next »