I am working with a JSON object that I need to parse in order to retrieve specific data. The structure is as follows:
"id": "5019b4b40cd8a056446b8eb4",
"checkItemStates": [
{
"idCheckItem": "xxxxxxxx",
"state": "complete"
}, {
"idCheckItem": "xxxxxxxx",
"state": "complete"
}
],
..........etc for about 20 more lines.
My goal is to extract the following information:
"member": {
"id": "XXXXXXXXXXXXXXXc",
"avatarHash": "XXXXXXXXXXXXXXXXXXXXXXXXX",
"fullName":
}
I specifically need to access the fullName, but there could be multiple members present in each object - ranging from 2 to 20 members. Since there are hundreds of objects, it's impossible to know how many members will be in each one.
How can I
- loop through a group of JSON objects using foreach?
- retrieve member.fullName from each object regardless of the number of members?