What does $$ mean in php?
In PHP, $$
means that you are going to inflict years of pain and suffering on at least one maintenance programmer. Note that you may end up as a maintenance programmer.
It is a variable variable. Imagine the following:
$quux = 'bar';
$foo[$quux] = "baz";
echo $foo['bar']; //prints baz
If it weren't for such a thing as arrays, you can try something like this:
$quux = 'bar';
$$quux = "baz";
echo $bar; //prints baz
Luckily we have arrays, so please don't use variable variables unless you are doing something confusing and magical *
and have no other choice.
*
: Please don't do folded magic things.
a source to share
They are called variable variables .
$foo = 'bar';
$id = 'foo';
echo $id; // prints foo
echo $$id; // prints bar
a source to share
in the PHP manual of course
http://www.php.net/manual/en/language.variables.variable.php
note that this is an outdated and meaningless syntax and you should always use arrays.
a source to share