views:

228

answers:

6

Normally I would use !=, then when I saw this sign <> it means not equal to as well.

After that, I went to search on Google, what's the difference between <> and !=. But I could not find the answer.

Anyone care to explain?

Edit:

Thanks for the answers guys =)

+2  A: 

In PHP, != and <> are equivalent, you can see more about them here: http://www.php.net/manual/en/language.operators.comparison.php

Alan Geleynse
+3  A: 

There is no difference. Some languages use <> and some use !=, and some like PHP allow both.

Michael Goldshteyn
Somebody downvoted this answer please explain!
Trufa
+2  A: 

According to the PHP docs, they're the same.

fennec
+14  A: 

<> has a higher precedence than !=. Otherwise they're identical.

deceze
As to why there's two... most likely legacy. `<>` used to be/is popular in other languages, so PHP adopted it as well.
deceze
Oh, come on everybody, stop upvoting this ridiculous ten-word answer. :o)
deceze
A: 

VB.NET use <> instead of !=

Talha Bin Shakir
A: 

some languages do not know the != operator, instead they use <>

but in PHP you can use both

Tomas Jancik