- var_dump: documentation ( source)
- json_decode: documentation ( source)
- get_object_vars: documentation ( source)
<?php
$json = '{"1":"A"}';
$arrWorks = json_decode($json, true);
var_dump($arrWorks);
var_dump($arrWorks[1], $arrWorks['1']);
echo "\n=================\n";
$arrDoesntWork = get_object_vars(json_decode($json));
var_dump($arrDoesntWork);
var_dump($arrDoesntWork[1], $arrDoesntWork['1']);