$data = '{"name":"CocaCola","price":1,"sync":0,"id":10792}';
$data = json_decode($data);
print_r((array)$data);
//Array ( [name] => CocaCola [price] => 1 [sync] => 0 [id] => 10792 )
print_r((array)$data["id"]);
//nothing?
This piece of code is not logic for me. Can I get any explanation of this behaviour and how to fix it?