PHP Comparison Operators

Use of PHP Comparison Operators is comparing two values (number or string).

==Is equal to
!=Is not equal to
<>Is not equal to
!==Is Identical
>Greater than
<Less than
>=Greater than or equal to
<=Less than or equal to

$a = 20;
$b = 30;
if( $a == $b ) {
  echo "a and b is equal";
}else {
  echo "a is not equal to b";


Subscribe Updates via Email

Join 49,000+ W3schools lovers and get all the latest tutorials, programs, algorithms in your inbox.