PHP $ and $$ Variables

The $var (single dollar) is a regular variable with the name var that can hold any value such as a string, integer, float, or other object.

The $$var (double dollar) is a reference variable that contains the $variable’s value.

Lets see an example to understand it clearly:

$x = "xyz";  
$$x = 20;  
echo $x."<br/>";  
echo $$x."<br/>";  
echo $xyz;  

Now Lets see an other example to understand it more clearly.

$$p="Hypertext Preprocessor";  
echo $p. "<br>";  
echo $$p. "<br>";  
echo "Abbrevation of $p is " . $$p. "</br> </br>"; 
echo "Abbrevation of $p is " . $PHP; // another way of writting above code 
PHP and