PHP $$ variable

$$ variable assigns value of variable's value.  

Example :

<?php
$str = "xyz"; //single dollar normal variable
$$str = 500; // double dollar reference variable
echo $str."<br/>"; // prints value of variable $str
echo $$str."<br/>"; // prints value of double dollar
echo $xyz;
?>

Output :

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

25139