Comparison

Comparison operators, as their name implies, allow you to compare two values.

PHP comparisons exists with type-juggling, ==, <>, <=>, switch() and !=, and with type checks, match(), === and !==.

Inequalities only exist with type-juggling.

There are also functions dedicated to comparisons, with specific applications : strcmp(), strcasecmp(), strnatcasecpm(), strcoll(), similar_text(), levensthein(), bccomp(), version_compare(), hash_equals().

<?php

if ($a == $b) {
    print "a and b are equal";
}
?>

Documentation

See also PHP Variable Comparison

Related : Operators, Type Juggling, Switch, Match, Spaceship Operator