I'm trying to get the IDs of the steam groups someone is connected to. Here is the json output:
{
"response": {
"success": true,
"groups": [
{
"gid": "111"
},
{
"gid": "222"
},
{
"gid": "333"
},
{
"gid": "444"
},
{
"gid": "555"
}
]
}
}
I've attempted it via:
$groupIDs = $reply['response']['groups'];
foreach ($groupIDs as $gID) {
// Do stuff
}
I'm getting the following error, but I'm struggling to see how to correct it.
Invalid argument supplied for foreach()
Sorry I didn't make it clear. I'm already decoding it before the foreach().
$reply = json_decode($reply, true);