Example:
$x=array('a'=>' ant','b'=>'boat ');
$s='a';
$y='$s';
echo $x[$$y];
I want to echo the value of key 'a' by indirectly referencing it via the
variable $y. The above is NOT correct, I know.
How do I indirectly reference a variable in PHP?
TIA,
Larry Woods
$x=array('a'=>' ant','b'=>'boat ');
$s='a';
$y='$s';
echo $x[$$y];
I want to echo the value of key 'a' by indirectly referencing it via the
variable $y. The above is NOT correct, I know.
How do I indirectly reference a variable in PHP?
TIA,
Larry Woods
Comment