I have a JSON file like this:
{
"numeric1": {
"id": "numeric1",
"name": "alphanumeric1",
"key": "alphanumeric2",
"expire": "alphanumeric3",
"status": true,
"ads": true
},
etc...
}
with (etc...) I mean that matrix is repeated more times. I parse it with PHP using:
$allowed = json_decode(file_get_contents("allowed.json"), true);
Then I get an array like:
Array
(
[0] => Array
(
[id] => numeric1
[name] => alphanumeric1
[key] => alphanumeric2
[expire] => alphanumeric3
[status] => 1
[ads] => 1
)
etc....
)
So I lose the first level of associative keys, I have
[0] => Arrayinstead of
["numeric1"] => Array
How can I keep the first level of my JSON array? Thanks.