重複の可能性:
名前にドットを含む 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'];
どちらも失敗します。お時間をいただきありがとうございます。