|
Note: This manual is provided for your convenience only - this is not the official source and may not be 100% up to date. Variable variablesSometimes it is convenient to be able to have variable variable names. That is, a variable name which can be set and used dynamically. A normal variable is set with a statement such as: A variable variable takes the value of a variable and treats that as the name of a variable. In the above example, hello, can be used as the name of a variable by using two dollar signs. i.e.
At this point two variables have been defined and stored in the
PHP symbol tree: produces the exact same output as: i.e. they both produce: hello world.
In order to use variable variables with arrays, you have to
resolve an ambiguity problem. That is, if you write
|
|