$variable $variables type question

Posted on 16th Feb 2014 by admin

I need to be able to designate an array element dynamically, so I thought to use a variable variable, but it doesn't work:
Code: $test = array(1,2);
$num = "[0]";
echo $test{"$num"}; // expecting 1
Not working. Is this possible?

Other forums