I already can grasp the idea on how they work, but I can not understand there usefulness and how to use them.
a variable variables definition is: a variable variable takes the value of a variable and treats that as the name of a variable. Good I understand all that not a problem for me.
Code: Select all
<?php
$test="This is test";
$b="test";
$a=${$b};
echo $a;
?>
output "This is test"The problem for comes when I try to think of a reason to use a variable
variable, so if anyone can show me an easy to follow example of a variable variable in use, that will I hope help clarify things in my mind.
Thank You.