Re: ! and !=

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



	Doh, of course! Just not thinking about the scope of the operator. If $var1 = 1, then !$var1 = 0....
	Thanks everyone!

George

----- Original Message -----
From: Tom Rogers <trogers@xxxxxxxxxx>
Date: Wednesday, April 22, 2009 17:01
Subject: Re: [PHP] ! and !=
To: George Langley <george.langley@xxxxxxx>
Cc: php-general@xxxxxxxxxxxxx

> Hi,
> 
> Thursday, April 23, 2009, 8:30:34 AM, you wrote:
> GL>         Hi 
> all. Maybe I'm just getting confused by all the
> GL> languages I'm trying to work with! But, isn't:
> 
> GL> if(!$var1 == $var2){
> 
> GL> the same thing as
> 
> GL> if($var1 != $var2){
> 
> GL>         #1 doesn't 
> work, #2 does.
> GL>         Thanks!
> 
> 
> GL> George Langley    Multimedia Developer    Audio/Video Editor   
> GL> Musician, Arranger, Composer www.georgelangley.ca
> 
> GL> "Too many choices, too little sleep."
> 
> Use brackets to make them the same:
> 
> if(!($var1 == $var2)) {
> 
> -- 
> regards,
> Tom
> 
> 

George Langley    Multimedia Developer    Audio/Video Editor    Musician, Arranger, Composer www.georgelangley.ca



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux