By: Andi, Stig and Derick Emailed: 1697 times Printed: 2202 times
Comparison operators enable you to determine the relationship between two operands.
When both operands are strings, the comparison is performed lexicographically. The comparison results in a Boolean value. For the following comparison operators, automatic type conversions are performed, if necessary.
|= =||Equal to||
Checks for equality between two arguments performing type
conversion when necessary:
|!=||Not equal to||Inverse of = =.|
Checks if first operand is greater than second
Checks if first operand is smaller than second
|>=||Greater than or equal to||
Checks if first operand is greater or equal to second
|<=||Smaller than or equal to||
Checks if first operand is smaller or equal to second
For the following two operators, automatic type conversions are not performed and, therefore, both the types and the values are compared.
|= = =||Identical to||
Same as == but the types of the operands have to match. No
automatic type conversions are performed:
|!= =||Not identical to||The inverse of = = =.|
Be the first one to add a comment
Most Viewed Articles (in PHP )
Most Emailed Articles (in PHP)