There is the following JSON code that appears by processing the array:
{ "success": true, "username": "xxx", "userid": 1, "subscriptions": [{ "name": "Counter-Strike: Global Offensive", "acquired": 1469815540, "expiring": 2147483647 }, { "name": "Unknown", "acquired": 1469815540, "expiring": 2147483647 }] }
The array appears approximately as follows:
$info['subscriptions'][$i]['acquired'] = $res[$i]['acquired']; $info['subscriptions'][$i]['expiring'] = $res[$i]['expiring'];
But you need JSON to look like this:
{ "success": true, "username": "xxx", "userid": 1, "subscriptions": { "1": { "name": "Auto", "acquired": 0, "expiring": 0 }, "2": { "name": "Manual", "acquired": 0, "expiring": 0 } } }
Already do not understand what to do.