![](http://www.studyzone4u.com/assets/image/ads6.jpg)
What is the difference between $name and $$name?
Last updated 5 years, 3 months ago | 4672 views 75 5
![Card image](/static/app-assets/images/sz4u-cover.jpg)
$name and $$name both are variables but with a single difference that is $name is just a normal php variable where as $$name is known as reference variable. It allow you to use $name variable's value as a variable for getting $$name variable value.
$name = 'Roshan';
$$name = 'Singh';
echo $name . "<br>";
echo $$name . "<br>";
// value of "$name" variable
echo $Roshan
//output
Roshan
Singh
Singh // This is value of "$Roshan" variable