我正在使用 expedia API,它运行良好,但我不知道如何访问这种特殊类型的数组键。回应如下
$response =
stdClass Object
(
[@size] => 1
[@activePropertyCount] => 144
[city] => 1
[@hotelId] => 12345
[HotelSummary] => stdClass Object
(
[@order] => 0
[@ubsScore] => 1074874
[hotelId] => 151689
[RoomRateDetailsList] => stdClass Object
(
[RoomRateDetails] => stdClass Object
(
[roomTypeCode] => 195577
[rateCode] => 202369379
[maxRoomOccupancy] => 3
[quotedRoomOccupancy] => 2
[minGuestAge] => 0
[roomDescription] => Deluxe Room
[propertyAvailable] => 1
[propertyRestricted] =>
[expediaPropertyId] => 526332
)
)
)
)
我想访问 'city' 键下的 @hotelId 的值,但我不能
我尝试了两种类型,但两次都失败了
$response->hotelId
and
$response->@hotelId
请帮助我..提前谢谢你