RE: [PHP] php in css not working with IF's
| From: | Jack Dempsey | Date: | Thu, 04 Oct 2001 05:52:45 +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-69887@lists.php.net to get a copy of this message | ||
have you thought about a switch statement? haven't looked at your code, but
that would allow you a default, and then a bunch of cases, etc...
jack
-----Original Message-----
From: Jason Dulberg [mailto:jdulberg@nas.net]
Sent: Thursday, October 04, 2001 1:43 AM
To: Rasmus Lerdorf
Cc: php-general@lists.php.net
Subject: RE: [PHP] php in css not working with IF's
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
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net