I am trying to use simplexml to access the hotelname from an api, showing a hotel list.
I have used this code so far. It seems right to me, but I still can't get it to work.
<?php
$xml_file = 'http://dev.api.ean.com/ean-services/rs/hotel/v3/list?minorRev=99&apiKey=ycdydfqdz4w5huxv4psfxs8h&cid=55505&locale=en_US¤cyCode=USD&supplierCacheTolerance=MED_ENHANCED&countryCode=US&city=Dallas&stateProvinceCode=TX&searchRadius=50&numberOfResults=20&arrivalDate=08/31/2014&departureDate=09/15/2014&minRate=100&maxRate=1000&room1=1&numberOfAdults=2';
$xml = simplexml_load_file($xml_file);
$response = $xml->HotelListResponse->HotelList->HotelSummary;
foreach($response as $val){
echo $val->name;
}
?>