How do I iterate an array in an array?
Some on the objects in my array have a nested array. I'm having trouble getting the values these arrays.
This is an example from the array:
- {
"item": [
{
"title": "Sat, 01 Dec",
"pubDate": "Sat, 01 Dec 2018 00:00:00 GMT",
"episodes": {
"episode": {
"show": "The Gadget Show",
"name": "Episode 9",
"format": "s28e09",
"summary": ""
}
}
},
{
"title": "Wed, 28 Nov",
"description": ""
"pubDate": "Wed, 28 Nov 2018 00:00:00 GMT",
"episodes": {
"episode": [
{
"show": "Adam Ruins Everything",
"name": "Adam Ruins Guns",
"format": "s03e01",
"summary": "",
},
{
"show": "Adam Ruins Everything",
"name": "Adam Ruins Guns",
"format": "s02e23",
"summary": "",
}
},
{
"title": "Tue, 27 Nov",
"description": "",
"pubDate": "Tue, 27 Nov 2018 00:00:00 GMT",
"episodes": {
"episode": [
{
"show": "The Great Christmas Light Fight",
"name": "Episode 1",
"format": "s06e01",
"summary": "",
},
{
"show": "The Great Christmas Light Fight",
"name": "Episode 2",
"format": "s06e02",
"summary": ""}
]
}
}
- ]
- }
This is the code I'm trying to get to work:
The items that don't have a child array work fine, but the items that do have nested arrays, I can only get the first value.
Thank you for any help.