php craete dynamic variable code example
Example 1: php variables
<?php
$string = 'string';
$number = 1;
?>
Example 2: php get variable by string name
${$variableName} or $$variableName;
//example:
$variableName = 'foo';
$foo = 'bar';
// The following are all equivalent, and all output "bar":
echo $foo;
echo ${$variableName};
echo $$variableName;