我有以下的JSON对象:
$json = '{
"Name": "Peter",
"countries": {
"France": {
"A": "1",
"B": "2"
},
"Germany": {
"A": "10",
"B": "20"
},
....
}
}';
我希望能够像解析数组一样解析属性 "countries" 中对象的属性。在Javascript中,我会使用lodash函数values
。在PHP中是否有类似的函数可以轻松实现?
json_decode
http://php.net/manual/zh/function.json-decode.php - Colin Schoen