php3-list | 199908
Date: 08/11/99
- Next message: dbrogdon <email protected>: "RE: [PHP3] if statment"
- Previous message: Gianluca Baldo: "RE: [PHP3] if statment"
- In reply to: Joshua L Bowser: "[PHP3] if statment"
- Next in thread: dbrogdon <email protected>: "RE: [PHP3] if statment"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wed, 11 Aug 1999, Joshua L Bowser wrote:
> Why does this return true even when $ll = NZ?
>
> if ($ll != "AM") || ($ll != "NZ") {
Because if $ll == "NZ", then is != "AM", so the left half evaluates to
true, so the entire check evaluates to true. In fact, this statement will
always return true, since a variable can never be two values at the same
time. :)
> Am I doing this OR statement right?
Well, do you want
if (($ll != "AM") && ($ll != "NZ")) {
by any chance? So, $ll is neither AM or NZ?
-adam
-- / adam maccabee trachtenberg | visit college life online \ \ adam <email protected> | http://www.student.com /
- Next message: dbrogdon <email protected>: "RE: [PHP3] if statment"
- Previous message: Gianluca Baldo: "RE: [PHP3] if statment"
- In reply to: Joshua L Bowser: "[PHP3] if statment"
- Next in thread: dbrogdon <email protected>: "RE: [PHP3] if statment"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

