Im wanting to dynamically access a multidimensional array, as i have a need to display the full path within a config file. Below are a couple of examples of how i know you can access the value at a certain level.
echo $results['Data']['MetaAttrListId']['0'];
$string = "MetaAttrListId";
echo $results['Data'][$string]['0'];
But what i want to be able to do is provide the full location/path to that area in a string. Like so.
$string = "['Data']['MetaAttrListId']['0']";
echo $results[$string];
the output of the multidimensional array im accessing.
(
[Data] => Array
(
[MetaTitle] => Array
(
[0] => Vauxhall combo 1.3 cdti in stunning condition low mileage long mot till august
)
[MetaAttrListId] => Array
(
[0] => Posted
[1] => Make
[2] => Model
[3] => Year
[4] => Mileage
[5] => Seller type
[6] => Body type
[7] => Fuel type
[8] => Transmission
[9] => Colour
[10] => Engine size
)
[MetaAttrListValue] => Array
(
[0] => 1 day ago
[1] => Vauxhall
[2] => COMBO
[3] => 2005
[4] => 79000
[5] => Private
[6] => Car Derived Van
[7] => Diesel
[8] => Manual
[9] => Red
[10] => 1248
)
)
[Error] =>
)