I'm confused in how to use $$ to use a string as a variable, mainly when it comes to use a string to refer an array index. Consider the following case:
$colors = array(
'r'=>"red",
'b'=>"blue"
);
$vr = "colors[r]"; //I tried even this "color['r']"
echo $$vr; // I tried even this ${$vr}
Can anyone tell if it is possible to do the above. expected o/p is red using "color[r]" as string and then using it as variable.