可能重复:
名称中带有点的 php 对象属性
我正在处理 PHP,获取 Microsoft Web 服务返回的对象,并且对象名称中有句点!
object(stdClass)#22 (1) {
["DAE.Country"]=>
array(24) {
[0]=>
object(stdClass)#23 (2) {
["CountryName"]=>
string(4) "Asia"
["ID"]=>
string(2) "27"
}
}
}
如何在 PHP 中访问名称中带有句点的对象?
$response->DAE_GetCountryListResult->DAE.Country;
和
$response->DAE_GetCountryListResult-['DAE.Country'];
都失败了。感谢您的时间。