【发布时间】:2018-10-16 11:06:28
【问题描述】:
我有这个 Json 文件,我想做的是访问所有“名称”属性。有没有办法访问该属性。我想用 PHP (laravel) 来做到这一点。因为这个 json 有动态名称,所以我无法找到访问它的方法。
[
[
{
"2": {
"id": 2,
"name": "Asiri Medical Hospital - Kirula Road - Colombo 05",
"specializations": [
{
"id": 58,
"name": "Endocrinologist"
},
{
"id": 122,
"name": "Diabetologist"
}
]
},
"3": {
"id": 3,
"name": "Asiri Central Hospital - Norris Canal Road-Colombo 10",
"specializations": [
{
"id": 58,
"name": "Endocrinologist"
},
{
"id": 122,
"name": "Diabetologist"
}
]
},
"11": {
"id": 11,
"name": "Ninewells Care Mother and Baby Hospital (Pvt) Ltd",
"specializations": [
{
"id": 58,
"name": "Endocrinologist"
}
]
}
]
]
【问题讨论】:
-
问题被标记为重复,但在重复中指定了错误的问题。实际重复是:stackoverflow.com/questions/40635146/…