I create an array which ends up with quite a bit of data. An example of this array is like so.
array:9 [▼
0 => array:9 [▼
"ID" => "1232806"
"Date" => "21/04/2016"
"Name" => "Test"
"Owner" => "Someone"
"Value" => "2160.00"
"Status/Stage" => "70%"
0 => array:2 [▼
"Structure" => ""
"Prospect" => "No"
]
1 => array:2 [▼
0 => array:8 [▼
"Quote ID" => "Q0020"
"Name" => "Test"
"Amount" => "2160"
]
1 => array:2 [▼
0 => array:1 [▼
"Type" => "New"
]
1 => array:1 [▼
"Month" => "June 16"
]
]
]
]
]
I am now trying to get the data out of this array. I can get the top level items out without issue
foreach ($array as $data) {
echo $data["ID"];
echo $data["Date"];
echo $data["Name"];
...
}
I am struggling with the inner data however. I am trying something like
foreach ($array as $data) {
echo $data["ID"];
echo $data["Date"];
echo $data["Name"];
foreach ($data as $innerData) {
echo innerData["Structure"];
echo innerData["Prospect"];
}
}
If I do this however, it complains about an Illegal String Offset. How can I get access to all the different data within this array?
Thanks
Created a question showing how I collect the data as I could be doing this wrong https://stackoverflow.com/questions/36837239/processing-xml-data-into-array
Status/Stage?$before$innerDatapost typo or code bug?