PHP Comparison Operators Tutorial

This video tutorial covers PHP comparison operators.

PHP Comparison Operators

The comparison operators that are used in PHP are listed in the table below.

Operator Description Example
== is equal to 1 == 2 returns false
!= is not equal to 1 != 2 returns true
<> is not equal 1 <> 2 returns true
> is greater than 1 > 2 returns false
< is less than 1 < 2 returns true
>= is greater than or equal to 1 >= 2 returns false
<= is less than or equal to 1 <= 2 returns true