PHP comparison operators
PHP comparison operators
Comparison Operators:
- Equal (==)
- Identical (===)
- Not equal (!= or <>)
- Not identical (!==)
- Greater than (>)
- Less than (<)
- Greater than or equal to (>=)
- Less than or equal to (<=)
php comparison operators
Example :-
<?php
$a=10;
$b=5;
$c=20;
$d=20;
var_dump($a < $c); //true
echo"<br>";
var_dump($a < $b);
echo"<br>";
var_dump($a<=$c);//t
echo"<br>";
var_dump($b>$c);//f
echo "<br>";
var_dump($c>=$d);//true
echo "<br>";
var_dump($c==$d);//t
echo"<br>";
var_dump($a != $d);//t
?>
php comparison operators
OUTPUT :-
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(true)
bool(true)
bool(false)
bool(true)
bool(false)
bool(true)
bool(true)
bool(true)
Related Post :-
Post a Comment