Question and answer is powered by AnsPress.io
I am study in php programming language and I see this type of variable in php. I don’t know what is the different between $variable and $$variable in php, please explain it.
In PHP $variable is used to store variable value and when it echo the value is display. The $$variable is the variable of a variable, it can be used to store variable of a variable.
For Example:
<?php
$variable = “pen”;
$pen= “blue”;
echo $variable; //Output:- pen
echo $$variable;//output :-blue