Answers for "php get variable by string name"

PHP
0

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;
Posted by: Guest on January-04-2021

Code answers related to "php get variable by string name"

Browse Popular Code Answers by Language