Difference between revisions of "PHP variable"

From Wiki @ Karl Jones dot com
Jump to: navigation, search
(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...")
 
(No difference)

Latest revision as of 18:42, 20 September 2016

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