PHP variable

From Wiki @ Karl Jones dot com
Revision as of 18:42, 20 September 2016 by Karl Jones (Talk | contribs) (Created page with "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...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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