As you all know how can we declare simple kind of variable in php .
$sign + name of your variable = value that you want to assign to that variable .
For example :
$test = "testing continue";
$create = "world";
But now lets look at the use of $$ sign in php
First lets take an example :
$create = "world";
$$create = "India";
This variables are same as
$create = "world";
$world = "india";
In short
and
are same ..
Enjoy…...
$sign + name of your variable = value that you want to assign to that variable .
For example :
$test = "testing continue";
$create = "world";
But now lets look at the use of $$ sign in php
First lets take an example :
$create = "world";
$$create = "India";
This variables are same as
$create = "world";
$world = "india";
In short
echo $create $($create);and
echo $create $world;are same ..
Enjoy…...
Comments
Post a Comment