...

/

Comparison Operators

Comparison Operators

This lesson covers the comparison operators and how you can use them in PHP. It also covers a special comparison operator, i.e., the spaceship operator.

Basic operators

Comparison operators, as the name suggests, allow you to compare two values. The following table illustrates the different comparison operators in PHP:

Operator Name Example
== Equal a==b
=== Identical a===b
!= Not Equal a!=b
!==
...