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

Variable

By Angela Bradley, About.com

Definition: A variable is a character or string used to represent a value. It can represent a single value or an expression consisting of other variables. In the case of PHP a variable is used to represent any other data and always begins with a dollar sign [$].
Examples:
X = 5

In this expression, X is a variable

Y = 4 * Z

In this expression Y is a variable, as is Z

$cat = "Spot";

In PHP a variable is defined with a dollar sign [$] as $cat is above.

Explore PHP / MySQL

More from About.com

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

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

All rights reserved.