I am trying to access each object through a foreach...and I don't know how exactly because in that json array is a key for which there is a certain number of records and then another key with other values, etc. And if you noticed, there is also a color. How do I display the color in a json? I need that on my page.
This is my json:
{
"7": [{
"idType": 0,
"nrReq": 41,
"dataD": "2017-05-14",
"typeC": "CO",
"startDate": "2017-05-16",
"endDate": "2017-05-17",
"dataA": "2017-05-14",
"color": "000080"
}, {
"idType": 0,
"nrReq": 42,
"dataD": "2017-05-14",
"typeC": "CM",
"startDate": "2017-05-23",
"endDate": "2017-05-24",
"dataA": "2017-05-18",
"color": "000080"
},
"8": [{
"idType": 0,
"nrC": 53,
"dataD": "2017-05-20",
"typeC": "CO",
"startDate": "2017-05-23",
"endDate": "2017-05-23",
"dataA": "2017-05-20",
"color": "ffd9b3"
}],
"25": [{
"idType": 0,
"nrC": 51,
"dataD": "2017-05-23",
"typeC": "CP",
"startDate": "2017-05-29",
"endDate": "2017-05-30",
"dataA": "2017-05-20",
"color": "ff6600"
}]
}
How should it look? I think it should be 2 foreachs...