Equality Operators and Numeric Values
Operator Example Meaning
== $num1 == $num2 $num1 is equal to $num2
!= $num1 != $num2 $num1 is not equal to $num2
<=> $num1 <=> $num2 $num1 is compared to $num2 with a signed return;
1 if $num1 is greater than $num2,
0 if $num1 is equal to $num2, and
-1 if $num1 is less than $num2
Related examples in the same category