!=和<>之间的区别[重复]

This question already has an answer here:

I've always been using != as "not equal to" in C++ and PHP. I just realized <> does the same thing. What's the difference?

Just in case if there is no difference, why does <> exist?

</div>

They are the same, just different syntax

$a != $b Not equal TRUE if $a is not equal to $b after type juggling.

$a <> $b Not equal TRUE if $a is not equal to $b after type juggling.

Source: PHP Documentation

They are the same

$a != $b    Not equal   TRUE if $a is not equal to $b after type juggling.
$a <> $b    Not equal   TRUE if $a is not equal to $b after type juggling.