PHP variable

From Wiki @ Karl Jones dot com
Jump to: navigation, search

A variable is a name for a data storage location. A variable contains a value.

In PHP, variables begin with a dollar sign ($).

Some variables are built into PHP.

Other variables are defined by the programmer.

Example

<?php
$msg = "Hello World";
echo $msg;
?>

The above example sets the variable named $msg equal to the value "Hello World". (The equal sign (=) is the PHP assignment operator.

The echo keyword then displays "Hello World" for the user.

See also

External links


PHP