PHP assignment operator

From Wiki @ Karl Jones dot com
Revision as of 18:47, 20 September 2016 by Karl Jones (Talk | contribs) (Created page with "In PHP, the '''assignment operator''' is an equal sign ('''='''). The assignment operator assigns a value to a variable. == Example == <pre> <?php $msg...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

In PHP, the assignment operator is an equal sign (=).

The assignment operator assigns a value to a variable.

Example

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

The above example assigns the value "Hello World" to a variable named $msg.

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

See also

External links