Re: Logical Operators

From: Date: Mon, 28 Apr 2003 14:47:06 +0000
Subject: Re: Logical Operators
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-145534@lists.php.net to get a copy of this message
use empty function or === operator <ed@homes2see.com> a écrit dans le message news: Pine.LNX.4.04.10304280930120.22951-100000@home.homes2see.com... > > I'm trying to write a line that checks if 3 variables are all the same > value (nothing) to set another variable. > > if ($a == "" && $b == "" && $c == "" ) { > > $d = "something"; } else { > > $d = "somethingelse"; } > > It doesn't seem to work the way I want it to. All 3 variables have to > == "" in order for $d to equal "something" but my variable are always > equal to "" but $d always comes out as "somethingelse". Are the operators > wrong in my statement? > > Thanks, > > Ed > >

« previous php.general (#145534) next »