Answers for "how i get variable from a string"

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 "how i get variable from a string"

Browse Popular Code Answers by Language