Dynamically Setting and Accessing Variables : Print « Development « PHP






Dynamically Setting and Accessing Variables





<html>
<head>
<title>Dynamically setting and accessing variables</title>
</head>
<body>
<?php
$holder = "user";
$$holder = "holder";


print "$user<br>";      
print $$holder;         
print "<br>";
print "${$holder}<br>"; 
print "${'user'}<br>";
?>
</body>
</html>

           
       








Related examples in the same category

1.Format our strings with line breaks to make our PHP code lines short
2.Variable interpolation
3.Demonstrating that the syntax of print is quite flexible
4.Use Print command to output string
5.A PHP Script Including HTML