I have this JSON in a URL:
{"success":true,"rgInventory":{"6073259621":{"id":"6073259621","classid":"1660549198","instanceid":"188530139","amount":"1","pos":1}}}
I need obtain the first entry after rgInventory
. The problem is the problem is that suppose that I don't know that there are "6073259621"
. How I can obtain it without know what there?
I try this but don't work:
$obj = json_decode(file_get_contents($url), true);
$obj2 = json_decode(json_encode($obj['rgInventory']), true);
$obj3 = json_decode(json_encode($obj2), true);
echo $obj3;