3
我有一个对象名称obj
这样的:PHP读取对象属性
stdClass Object
(
[@attributes] => stdClass Object
(
[CurrencyCode] => AUD
[CurrencyName] => AUST.DOLLAR
[Buy] => 17825.4
[Transfer] => 17933
[Sell] => 18092.95
)
)
我使用的一些方法:
obj[CurrencyCode]
obj ->CurrencyCode
但不工作,得到错误:Use of undefined constant CurrencyCode
如果使用: obj -> @attributes
得到错误:syntax error, unexpected ''@attributes'' (T_CONSTANT_ENCAPSED_STRING)