Monday, 4 March 2013

Filled Under:

difference between $a and $$a in php

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

$$var = 'to bbsphplearn';

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

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







0 comments:

Post a Comment