tags:

views:

162

answers:

3
+3  Q: 

php <> operator

can anyone tell me what this operator means exactly? is it the same as != (not equal)??

$foo = 'text';

if($foo <> 'photo') {
    echo 'foo';
} else {
    echo 'bar';
}
A: 

Yes, it's the same as != (see manual)

Henrik Paul
+2  A: 

That would be correct. It's pretty universal between languages. I usually use that method in my MSSQL queries/stored procedures.

PHP: Comparison Operators

invenetix
+9  A: 

< <= > >= <> have a slightly higher precedence then == != === !== in the order of operations. Aside from the difference in precedence <> and != have the same meaning.

P.S. You probably should never write code that depends on such a minute difference in the order of operations.

Zoredache
agreed. and thanks to you all. :)
ocergynohtna
Your welcome. :D
invenetix