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";


Scroll Back to Top