programming faqs interview questions tech technical educational freshers guide preparation interviews hr telephonic
try another color:
try another fontsize: 60% 70% 80% 90%
Programming FAQs

what is difference between $variable and $$variable in php?

Average: 5 (1 vote)

$variable is a normal

$variable is a normal variable
$$variable takes the value of a variable and treats that as the name of a variable

eg: $var = 'welcome';
echo $var //prints welcome

$$var = 'to programmingfaqs';

echo "$var ${$var}"; //prints welcome to programmingfaqs
echo "$var $welcome"; //prints welcome to programmingfaqs