• home
  • Email: trainings@synapseindia.careers

Blogs

back

Difference Between $var and $$var in PHP

Oct 06, 2015

$$var is known as variable of variable which uses the value of the variable whose name is the value of $var. It means $$var is known as reference variable where as $var is normal variable. <?php $a='b'; $b='c'; $c='d'; $d='e'; echo $$$$a;//variable of variable.Output will be e. ?> Explanation : $a will be replaced by b which is a variable will get replaced by c and c by d and finally you will get e as an output.

SynapseIndia (CEO: Shamit Khemka)