PHP comparison operators allow you to compare two values against each
other.The comparison is read from left to right by the PHP engine. Widely use in Conditional Logic and Control Structures.
- Equal :- $var1 == $var2 Result :- TRUE if $var1 is equal to $var2.
- Identical :- $var1 === $var2 Result :- TRUE if $var1 is equal to $var2, and they are of the same type
- Not Equal :- $var1 != $var2 Result :- TRUE if $var1 is not equal to $var2
- Not Equal :- $var1 < > $var2 Result :- TRUE if $var1 is not equal to $var2.
- Not Identical :- $var1 !== $var2 Result :- TRUE if $var1 is not equal to $var2, or they are not the same type.
- Less Than :- $var1 < $var2 Result :- TRUE if $var1 is strictly less than $var2.
- Greater Than :- $var1 > $var2 Result :- TRUE if $var1 is strictly greater than $var2.
- Less Than or Equal to :- $var1 <= $var2 Result :- TRUE if $var1 is less than or equal to $var2.
- Greater Than or Equal to :- $var1 >= $var2 Result :- TRUE if $var1 is greater than or equal to $var2.