![]() |
VOOZH | about |
In PHP, $var is used to store the value of the variable like Integer, String, boolean, character. $var is a variable and $$var stores the value of the variable inside it.
$var:
Syntax:
$variable = value;
Example 1: This example stores and displays values with $.
hello Geeks<br/>1<br/>34<br/>
$$var: $$var stores the value of $variable inside it.
Syntax:
$variable = "value"; $$variable = "new_value";
We can get another value by using the $value of the first variable.
Example 2: PHP program to demonstrates $$var.
hello Hello php
Difference between Both: The variable $var is used to store the value of the variable and the variable $$val is used to store the reference of the variable.