I have a JSON similar to the following:
{
"name": "Activities",
"description": "Activities",
"parent_group_id": 0,
"display": "Activities",
"group_id": 7,
"stamps": [
{
"stamp_id": 14,
"name": "Stamp 14",
"rank": 2
},
{
"stamp_id": 20,
"name": "Stamp 20",
"rank": 4
}
]
},
{
"name": "Games",
"description": "Games",
"parent_group_id": 0,
"display": "Games",
"group_id": 6,
"stamps": [
{
"stamp_id": 33,
"name": "Stamp 33",
"rank": 3
},
{
"stamp_id": 31,
"name": "Stamp 31",
"rank": 1
}
]
}
I want to get a list of each of the stamp_ids seperated by commas through PHP (eg. 14,20,33,31)
I have already tried this, with no luck:
$stampsdata = json_decode($stampsjson, true);
$numberofstamps = $stampsdata['stamps']['stamp_id']);
Can anyone help?