how to access php defined constant using a $variable as the name of the defined constant
php
Solution
echo constant ( $a . $b );
is what i think you are looking for as it is a constant.
Problem
I have a variable defined using define() I want to store a part of the name of that variable in a regular php $variable, then access that defined variable by setting the name dynamically. ie.: ``` define('xxx_yyy',123); $a='xxz'; $b='_yyy'; //How to I echo out "123" now? (without using echo xxx_yyy); //Something like these (don't work): echo $a$b; echo {$a$b}; ``` The only thing I can think of is: ``` $defined=get_defined_vars(); echo $defined[$a$b]; ``` but that seems clunky