Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 199908

Re: [PHP3] if statment From: Adam Trachtenberg (adam <email protected>)
Date: 08/11/99

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    /