5. PHP Comparision Operators:-
PHP Comparision Operators का Use दो Variable की Value को compare करने के लिए अर्थात उनमे relation बताने के लिए किया जाता है ।
इस Operator का use condition statement में भी किया जाता है । ये Operator Output को boolean fashion के रूप मे अर्थात true या false के रूप मे show करते है । यदि condition satisfied होती है तो True, Otherwise False Return करता है ।
PHP var_dump() function, data type and value को return करने के लिए use मे आता है ।
Operator |
Name |
Example |
Result |
== |
Equal |
$x == $y |
True if $x is equal to $y |
=== |
Identical |
$x === $y |
True if $x is equal to $y, and they are of the same type |
!= |
Not equal |
$x != $y |
True if $x is not equal to $y |
<> |
Not equal |
$x <> $y |
True if $x is not equal to $y |
!== |
Not identical |
$x !== $y |
True if $x is not equal to $y, or they are not of the same type |
< |
Less than |
$x < $y |
True if $x is less than $y |
> |
Greater than |
$x > $y |
True if $x is greater than $y |
>= |
Greater than or equal to |
$x >= $y |
True if $x is greater than or equal to $y |
<= |
Less than or equal to |
$x <= $y |
True if $x is less than or equal to $y |

Figure:-1 PHP Comparision Operator