0
What is the difference between $var and $var ?
What is the use of $var in PHP ?
3 Answers
+ 3
$ allows you to use the value of a variable as the name of another.
$var = "foo";
$var = "bar";
echo $foo;
+ 3
variable treat the value of another variable ast it name
$a=`hi'
$hi='hello'
echo$a
0
For example if,
$thisVar is holding value "otherVar"
and
$otherVar is holding value "Hello i'm other var"
and then when echo value of $thisVar using var var
syntax $thisVar, the resulting value will be "Hello i'm
other var" bcoz $thisVar is holding the name of otherVar.