PHPRO.ORG

Some people find them useful, others find them an abomination. Either way variable variables are a part of PHP. Here in this simple example we see how its done.


<?php

// create a variable
$var "foo";

// now a variable variable
$$var"bar";

// now we have a varible with the name of
// the first variables value and we can use it
echo $foo;
?>