php comparison operator, which allows comparison of two values.
Comparison operators, as their name implies, allow two values to be compared. You can also refer to the PHP type comparison table for examples of how different types compare to each other. (Recommended learning: PHP Programming from Beginner to Master)
The following example shows different results of using certain comparison operators:
Example
<?php $x=17; $y="17"; var_dump($x == $y); echo "<br>"; var_dump($x === $y); echo "<br>"; var_dump($x != $y); echo "<br>"; var_dump($x !== $y); echo "<br>"; $a=17; $b=8; var_dump($a > $b); echo "<br>"; var_dump($a < $b); ?>
The above is the detailed content of What are comparison operators in php. For more information, please follow other related articles on the PHP Chinese website!