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

Comparison Operators

By , About.com Guide

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
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

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

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

All rights reserved.