note 105293 added to language.variables.variable
| From: | OmarJuvera at osu1 dot php dot net | Date: | Mon, 08 Aug 2011 04:13:12 +0000 |
| Subject: | note 105293 added to language.variables.variable | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-182310@lists.php.net to get a copy of this message | ||
In this example, I have the variable $city.
To store the variable $city inside another variable:
<?php
$city = 'New York';
$var_container = 'city'; //$var_container will store the variable $city
echo "CONTAINER's var: " . $var_container;
echo "<br />";
echo "CONTAINER's value: " . $$var_container;
echo "<br />";
echo "VAR city: " . $city;
?>
The OUTPUT is:
CONTAINER's var: city
CONTAINER's value: New York
VAR city: New York
----
Server IP: 69.147.83.197
Probable Submitter: 76.171.88.108
----
Manual Page -- http://www.php.net/manual/en/language.variables.variable.php
Edit -- https://master.php.net/note/edit/105293
Del: integrated -- https://master.php.net/note/delete/105293/integrated
Del: useless -- https://master.php.net/note/delete/105293/useless
Del: bad code -- https://master.php.net/note/delete/105293/bad+code
Del: spam -- https://master.php.net/note/delete/105293/spam
Del: non-english -- https://master.php.net/note/delete/105293/non-english
Del: in docs -- https://master.php.net/note/delete/105293/in+docs
Del: other reasons-- https://master.php.net/note/delete/105293
Reject -- https://master.php.net/note/reject/105293
Search -- https://master.php.net/manage/user-notes.php