Jalpesh Jalpesh - 2 months ago 11
PHP Question

What is the difference between $a and $$a in php?


Possible Duplicate:

What does $$ mean in PHP?




I am new to PHP and I don't know what the difference between
$a
and
$$a
is.

Answer

If $a = 'b' then $$a is $b.

This is a variable variable. They are evil. Use arrays instead (which do the same thing, but more maintainably and with the ability to use array functions on them).

Comments