我有一个print_r的PHP对象,具有此结果
fieldData: {},
portalData: {
SubCategories: {
0: {},
1: {
recordId: "3",
SubCategories::SubCategoryName: "Multi-Channel",
modId: "0"
},
2: {},
3: {}
}
},
recordId: "2",
modId: "3"
如何访问SubCategoryName?
答案 0 :(得分:2)
您应该可以使用:
$object->portalData->SubCategories->{1}->{'SubCategories::SubCategoryName'}
– Magnus Eriksson 2分钟前