The php not equal comparison operator is !=
or <>
.
!=
Not equal to $x != $y
Returns true if $x is not equal to $y.
Code example:
<?php $x = 17; $y = "17"; var_dump($x != $y); // 返回 false,因为值相等 ?>
Output:
bool(false)
<>
not equal to $x <> $y
If $x is not equal to $y, return true.
<?php $x = 17; $y = "17"; var_dump($x <> $y); // 返回 false,因为值相等 ?>
Output:
bool(false)
For more PHP related knowledge, please visit PHP Chinese website!
The above is the detailed content of php is not equal to. For more information, please follow other related articles on the PHP Chinese website!