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

Operator

By Angela Bradley, About.com

Definition: In an expression, the Operator tells us what action to preform on the Operands. In PHP there are three types of operators:

Mathematical:
+ (plus), - (minus), / (divided by), and * (multiplied by)

Comparison:
> (greater than), < (less than), == (equal to), and != (not equal to)

Boolean:
&& (true if both operands are true), || (true if at least one operand is true), xor (true if ONLY one operand is true), and ! (true if a single operand is false)

Examples:
X == 3 + 4

In this expression == and + are the operands

6 > 10 - 5

In this expression > and - are the operands

X != 7

In this expression != is the operand

Explore PHP / MySQL
About.com Special Features

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

Easy ways to connect two computers for networking purposes. More >

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

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

All rights reserved.