Parsing nested json with php

[
{
“title”: “Doolittle”,
“artist”: “Pixies”,
“year”: “1989”,
“genre”: “Rock”,
“media”: [
{
“totalDiscs”: “1”,
“position”: “1”,
“tracks”: [
{
“title”: “Debaser”,
“number”: “1”,
“artists”:
},
{
“title”: “La La Love You”,
“number”: “10”,
“artists”:
},
{
“title”: “No. 13 Baby”,
“number”: “11”,
“artists”:
},
{
“title”: “There Goes My Gun”,
“number”: “12”,
“artists”:
},
{
“title”: “Hey”,
“number”: “13”,
“artists”:
},
{
“title”: “Silver”,
“number”: “14”,
“artists”:
},
{
“title”: “Gouge Away”,
“number”: “15”,
“artists”:
},
{
“title”: “Tame”,
“number”: “2”,
“artists”:
},
{
“title”: “Wave Of Mutilation”,
“number”: “3”,
“artists”:
},
{
“title”: “I Bleed”,
“number”: “4”,
“artists”:
},
{
“title”: “Here Comes Your Man”,
“number”: “5”,
“artists”:
},
{
“title”: “Dead”,
“number”: “6”,
“artists”:
},
{
“title”: “Monkey Gone To Heaven”,
“number”: “7”,
“artists”:
},
{
“title”: “Mr. Grieves”,
“number”: “8”,
“artists”:
},
{
“title”: “Crackity Jones”,
“number”: “9”,
“artists”:
}
]
}
],
“images”: [
{
“url”: “http://api.onemusicapi.com/20151208/images/discogs/1715114/1238757145”,
“width”: “600”,
“height”: “595”
}
],
“score”: 1
}
]

i am trying to fetch all the json value by key and print them in php

how to i go about doing it. i have seen a couple of examples on stackoverflow but i still could not get my output.

Could you please post the code that you tried which didn’t work for you? Maybe someone could give you suggestions as to how to fix it to give you the output you are looking for.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.