我的对象名是$ distinct1
print_r($distinct1)
显示下面的对象,但是当我尝试
echo $distinct1->properties->city
OR
echo $distinct1->distinct_id
我没有得到任何价值回报。有什么想法吗?
stdClass Object
(
[$distinct_id] => AAA
[$properties] => stdClass Object
(
[$city] => Palo Alto
[$country_code] => US
[$region] => California
[$name] => John Smith
)
)
答案 0 :(得分:2)
嗯,如果您的属性确实如此命名:
$distinct1->{'$properties'}->{'$city'}
但是如果可能的话,我会研究设置的机制,就像那样&把它固定在那里。
答案 1 :(得分:1)
该对象的属性名称实际上以$
开头,无论出于何种奇怪的原因。
echo $distinct1->{'$properties'}->{'$city'};