1. Home
  2. Computing & Technology
  3. PHP / MySQL

Comparison Operators

By Angela Bradley, About.com

Definition: A comparison operator compares one value to another. It can compare it in four different ways:

== - Equal to (also sometimes written as just = )
!= - Not equal to
> - Greater than (meaning the value on the left is larger then the one on the right)
< - Less than (meaning the value on the left is smaller than the one on the right)

Examples:
Some examples of comparison operators:
10 > 8
10 < 12
X = 5
y != 6

Explore PHP / MySQL

More from About.com

  1. Home
  2. Computing & Technology
  3. PHP / MySQL
  4. Programing Glossary
  5. Comparison Operator - PHP Comparison - PHP Operator

©2008 About.com, a part of The New York Times Company.

All rights reserved.