Re: ! and !=
| From: | Tom Rogers | Date: | Wed, 22 Apr 2009 23:01:02 +0000 |
| Subject: | Re: ! and != | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-291842@lists.php.net to get a copy of this message | ||
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