I don't know why, probably I'm just to stupid but I've been trying to extract stuff from an Expedia API Request for more than 2 hours now. Probably I've been working to long on this site today so that I don't see a simple mistake but anyway I don't find it. The API Request "HotelList" causes this problem for me, getting HotelDetails and extracting data from the return XML output worked just fine and on the first try.
The request/result I get for my request looks like this:
$result = $search->getHotels($dataArray);
--------------------------------------------
RESULT (print_r) LOOKS LIKE THIS
Array
(
[current_search] => Array
(
[check_in] => 05/08/2013
[check_out] => 05/13/2013
)
[title] =>
[hotels] => SimpleXMLElement Object
(
[customerSessionId] => XXXXXXXXXXXXX
[numberOfRoomsRequested] => 1
[moreResultsAvailable] => true
[cacheKey] => XXXXXXXXXXXXXXXXX
[cacheLocation] => XXXXXXXXXXXXXX
[cachedSupplierResponse] => SimpleXMLElement Object
(
[@attributes] => Array
(
[matchedLocale] => true
[matchedCurrency] => true
[tpidUsed] => 5102
[otherOverheadTime] => 5
[candidatePreptime] => 62
[supplierResponseTime] => 1950
[supplierResponseNum] => 5
[supplierRequestNum] => 513
[cachedTime] => 0
[supplierCacheTolerance] => NOT_SUPPORTED
)
)
[HotelList] => SimpleXMLElement Object
(
[@attributes] => Array
(
[activePropertyCount] => 562
[size] => 5
)
[HotelSummary] => Array
(
[0] => SimpleXMLElement Object
(
[@attributes] => Array
(
[ubsScore] => 2147483647
[order] => 0
)
[hotelId] => 126913
[name] => The New Yorker Hotel
[address1] => 481 Eighth Ave.
[city] => New York
[stateProvinceCode] => NY
I've been pretty much trying everything to get the name of this hotel but I can't even extract the check_in return result or anything like that. I was simply trying stuff like this:
echo $result->hotels->HotelList->HotelSummary[0]->name;
echo $result->HotelList->HotelSummary[0]->name;
echo $result->$HotelSummary[0]->name; or
echo $result->current_search->check_in;
and probably like 20 other combinations but there is simply no output at all.
I really hope someone can help me out here.
Best Regards Thomas