I have a variable defined using define (). I want to save part of the name of this variable in a regular php $ variable, then enter this variable by specifying it dynamically. i.e:.
define('xxx_yyy',123);
$a='xxz';
$b='_yyy';
echo $a$b;
echo {$a$b};
The only thing I can think of:
$defined=get_defined_vars();
echo $defined[$a$b];
but it seems awkward
source
share