我正在尝试从.json文件中获取所有对象。使用Core Data
对象,我想获得其中唯一的项目。我无法获得stylers
或color
file.json
visibility
PHP代码:
[
{
"featureType": "road.highway",
"elementType": "geometry.fill",
"stylers": [
{ "color": "red" }
]
}, {
"featureType": "road.highway.controlled_access",
"elementType": "geometry.fill",
"stylers": [
{ "visibility": "off" }
]
}, {
"featureType": "poi.business",
"elementType": "labels",
"stylers": [
{ "visibility": "on" }
]
}
]
答案 0 :(得分:0)
$value
是stdClass
个对象。因此,要拨打color
或visibility
,您需要:
echo $value->color;
echo $value->visibility;