How do I parse string of array so i can get the value of variable
sample string
$str = 'prices[holiday:waterpark][person:1_person]';
sample variable
$prices['holiday:waterpark']['person:1_person'] = 100;
I have tried using variables.variable way in php like this
$prices['holiday:waterpark']['person:1_person'] = 100;
$str = "prices\['holiday:waterpark'\]\['person:1_person'\]";
$str = str_replace('\\', '', $str);
echo $$str;
but thats not working and I get an error
"Undefined variable: $prices['holiday:waterpark']['person:1_person']"