Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/267.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
通过简单的XML php循环结果_Php_Xml_Simplexml - Fatal编程技术网

通过简单的XML php循环结果

通过简单的XML php循环结果,php,xml,simplexml,Php,Xml,Simplexml,我不知道如何循环一个简单的XML响应。我刚开始研究XML,可以通过PHP MYSQL进行循环,但不能通过简单的XML进行循环。有什么帮助吗 $XML = "&xml=<HotelListRequest><city>$citysearch</city><currencyCode>£</currencyCode><arrivalDate>01/17/2016</arrivalDate><departur

我不知道如何循环一个简单的XML响应。我刚开始研究XML,可以通过PHP MYSQL进行循环,但不能通过简单的XML进行循环。有什么帮助吗

$XML = "&xml=<HotelListRequest><city>$citysearch</city><currencyCode>£</currencyCode><arrivalDate>01/17/2016</arrivalDate><departureDate>01/18/2016</departureDate><supplierType>E</supplierType><RoomGroup><Room><numberOfAdults>$noaddults</numberOfAdults><numberOfChildren>$nochildren</numberOfChildren></Room></RoomGroup><numberOfResults>5</numberOfResults><locale>en_US</locale><sort>PRICE</sort></HotelListRequest>";

// Sending Request to API

$header[] = "Accept: application/xml";
$ch = curl_init();
curl_setopt( $ch, CURLOPT_HTTPHEADER, $header );
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch,CURLOPT_POST,5);
curl_setopt($ch,CURLOPT_POSTFIELDS,$XML);
curl_setopt( $ch, CURLOPT_URL, $url.$XML );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
$response = curl_exec($ch);
$response = simplexml_load_string($response);
$XML=“&XML=$citysearch£01/17/201601/18/2016E$noaddults$nochildren5en_USPRICE”;
//向API发送请求
$header[]=“接受:应用程序/xml”;
$ch=curl_init();
curl_setopt($ch,CURLOPT_HTTPHEADER,$header);
curl_setopt($ch,CURLOPT_CUSTOMREQUEST,'POST');
卷曲设置($ch,卷曲设置柱,5);
curl_setopt($ch,CURLOPT_POSTFIELDS,$XML);
curl_setopt($ch,CURLOPT_URL,$URL.$XML);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
$response=curl\u exec($ch);
$response=simplexml\u load\u字符串($response);
输出是

SimpleXMLElement Object ( [customerSessionId] => xxxxxxxx-6DB54xxxx [numberOfRoomsRequested] => 1 [moreResultsAvailable] => true [cacheKey] => 41ab978e:151c66db542:-446a [cacheLocation] => 10.186.170.129:7300 [HotelList] => SimpleXMLElement Object ( [@attributes] => Array ( [size] => 5 [activePropertyCount] => 1253 ) [HotelSummary] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [order] => 0 ) [hotelId] => 402789 [name] => Venture Hostel [address1] => 86 Tanner's Hill [city] => London [postalCode] => SE8 4PN [countryCode] => GB [airportCode] => LHR [supplierType] => E [propertyCategory] => 5 [hotelRating] => 2.0 [confidenceRating] => 52 [amenityMask] => 133120 [tripAdvisorRating] => 3.0 [locationDescription] => In London (Lewisham) [shortDescription] => <p><b>Property Location</b> <br />With a stay at Venture Hostel in London (Lewisham), you'll be close to Greenwich Market and O2 Arena. This hostel is within close proximity of Cutty Sark and [highRate] => 8.36 [lowRate] => 8.36 [rateCurrencyCode] => GBP [latitude] => 51.47361 [longitude] => -0.02712 [proximityDistance] => 3.9014914 [proximityUnit] => MI [hotelInDestination] => true [thumbNailUrl] => /hotels/5000000/4920000/4916900/4916812/4916812_41_t.jpg [deepLink] => http://www.travelnow.com/templates/55505/hotels/402789/overview?lang=en&currency=GBP&standardCheckin=1/17/2016&standardCheckout=1/18/2016&roomsCount=1&rooms[0].adultsCount=2 [RoomRateDetailsList] => SimpleXMLElement Object ( [RoomRateDetails] => SimpleXMLElement Object ( [roomTypeCode] => 200585535 [rateCode] => 205900877 [maxRoomOccupancy] => 2 [quotedRoomOccupancy] => 1 [minGuestAge] => 0 [roomDescription] => Shared Dormitory, Mixed Dorm (8 Bed) [currentAllotment] => 12 [propertyAvailable] => true [propertyRestricted] => false [expediaPropertyId] => 4916812 [rateKey] => 9b7dbc12-65ba-4a72-b9c0-f991e610f9ee [RateInfo] => SimpleXMLElement Object ( [@attributes] => Array ( [priceBreakdown] => true [promo] => false [rateChange] => false ) [ChargeableRateInfo] => SimpleXMLElement Object ( [@attributes] => Array ( [averageBaseRate] => 8.36 [averageRate] => 8.36 [commissionableUsdTotal] => 12.45 [currencyCode] => GBP [maxNightlyRate] => 8.36 [nightlyRateTotal] => 8.36 [surchargeTotal] => 11.70 [total] => 20.06 ) [NightlyRatesPerRoom] => SimpleXMLElement Object ( [@attributes] => Array ( [size] => 1 ) [0] => SimpleXMLElement Object ( [@attributes] => Array ( [baseRate] => 8.36 [rate] => 8.36 [promo] => false ) ) ) [Surcharges] => SimpleXMLElement Object ( [@attributes] => Array ( [size] => 2 ) [Surcharge] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [type] => ExtraPersonFee [amount] => 8.36 ) ) [1] => SimpleXMLElement Object ( [@attributes] => Array ( [type] => TaxAndServiceFee [amount] => 3.34 ) ) ) ) ) ) [ValueAdds] => SimpleXMLElement Object ( [@attributes] => Array ( [size] => 2 ) [ValueAdd] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [id] => 2048 ) [description] => Free Wireless Internet ) [1] => SimpleXMLElement Object ( [@attributes] => Array ( [id] => 2 ) [description] => Continental Breakfast ) ) ) ) ) ) [1] => SimpleXMLElement Object ( [@attributes] => Array ( [order] => 1 ) [hotelId] => 325381 [name] => Hostel 639 [address1] => 639 Harrow Road [address2] => Kensal Green [city] => London [postalCode] => NW10 5NU [countryCode] => GB [airportCode] => LCY [supplierType] => E [propertyCategory] => 5 [hotelRating] => 2.0 [confidenceRating] => 52 [amenityMask] => 256 [tripAdvisorRating] => 2.0 [locationDescription] => In London (North London) [shortDescription] => <p><b>Property Location</b> <br />With a stay at Hostel 639 in London (North London), you'll be close to Portobello Road Market and Royal Albert Hall. This hostel is close to Imperial College London [highRate] => 9.77 [lowRate] => 8.47 [rateCurrencyCode] => GBP [latitude] => 51.53012 [longitude] => -0.22551 [proximityDistance] => 5.5449877 [proximityUnit] => MI [hotelInDestination] => true [thumbNailUrl] => /hotels/3000000/2840000/2831600/2831521/2831521_73_t.jpg [deepLink] => http://www.travelnow.com/templates/55505/hotels/325381/overview?lang=en&currency=GBP&standardCheckin=1/17/2016&standardCheckout=1/18/2016&roomsCount=1&rooms[0].adultsCount=2 [RoomRateDetailsList] => SimpleXMLElement Object ( [RoomRateDetails] => SimpleXMLElement Object ( [roomTypeCode] => 200052408 [rateCode] => 200307052 [maxRoomOccupancy] => 8 [quotedRoomOccupancy] => 0 [minGuestAge] => 18 [roomDescription] => Shared Dormitory, Mixed Dorm (8 Beds) [promoId] => 214239009 [promoDescription] => Save 13% [currentAllotment] => 75 [propertyAvailable] => true [propertyRestricted] => false [expediaPropertyId] => 2831521 [rateKey] => 57c8780b-2a50-45ff-8f0a-bb08622f071e [RateInfo] => SimpleXMLElement Object ( [@attributes] => Array ( [priceBreakdown] => true [promo] => true [rateChange] => false ) [ChargeableRateInfo] => SimpleXMLElement Object ( [@attributes] => Array ( [averageBaseRate] => 9.77 [averageRate] => 8.47 [commissionableUsdTotal] => 12.62 [currencyCode] => GBP [maxNightlyRate] => 8.47 [nightlyRateTotal] => 8.47 [surchargeTotal] => 11.86 [total] => 20.33 ) [NightlyRatesPerRoom] => SimpleXMLElement Object ( [@attributes] => Array ( [size] => 1 ) [0] => SimpleXMLElement Object ( [@attributes] => Array ( [baseRate] => 9.77 [rate] => 8.47 [promo] => true ) ) ) [Surcharges] => SimpleXMLElement Object ( [@attributes] => Array ( [size] => 2 ) [Surcharge] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [type] => ExtraPersonFee [amount] => 8.47 ) ) [1] => SimpleXMLElement Object ( [@attributes] => Array ( [type] => TaxAndServiceFee [amount] => 3.39 ) ) ) ) ) ) ) ) ) [2] => SimpleXMLElement Object ( [@attributes] => Array ( [order] => 2 ) [hotelId] => 423378 [name] => RestUp London - Hostel [address1] => 172 New Kent Road [city] => London [postalCode] => SE1 4YT [countryCode] => GB [airportCode] => LTN [supplierType] => E [propertyCategory] => 5 [hotelRating] => 2.0 [confidenceRating] => 52 [amenityMask] => 196864 [tripAdvisorRating] => 3.0 [locationDescription] => In London (South Bank) [shortDescription] => <p><b>Property Location</b> <br />With a stay at RestUp London - Hostel, you'll be centrally located in London, convenient to London South Bank University and London Bridge. This hostel is close to [highRate] => 11.22 [lowRate] => 8.49 [rateCurrencyCode] => GBP [latitude] => 51.49413 [longitude] => -0.0906 [proximityDistance] => 1.0447516 [proximityUnit] => MI [hotelInDestination] => true [thumbNailUrl] => /hotels/6000000/5570000/5568700/5568679/5568679_65_t.jpg [deepLink] => http://www.travelnow.com/templates/55505/hotels/423378/overview?lang=en&currency=GBP&standardCheckin=1/17/2016&standardCheckout=1/18/2016&roomsCount=1&rooms[0].adultsCount=2 [RoomRateDetailsList] => SimpleXMLElement Object ( [RoomRateDetails] => SimpleXMLElement Object ( [roomTypeCode] => 200352902 [rateCode] => 202156304 [maxRoomOccupancy] => 10 [quotedRoomOccupancy] => 1 [minGuestAge] => 18 [roomDescription] => Bed in 10-Bed Dormitory with Shared Bathroom [promoId] => 213611478 [promoDescription] => Save 24% [currentAllotment] => 21 [propertyAvailable] => true [propertyRestricted] => false [expediaPropertyId] => 5568679 [rateKey] => cf24b9fd-4e06-4086-b142-236832744d6b [RateInfo] => SimpleXMLElement Object ( [@attributes] => Array ( [priceBreakdown] => true [promo] => true [rateChange] => false ) [ChargeableRateInfo] => SimpleXMLElement Object ( [@attributes] => Array ( [averageBaseRate] => 11.22 [averageRate] => 8.49 [commissionableUsdTotal] => 12.65 [currencyCode] => GBP [maxNightlyRate] => 8.49 [nightlyRateTotal] => 8.49 [surchargeTotal] => 11.88 [total] => 20.37 ) [NightlyRatesPerRoom] => SimpleXMLElement Object ( [@attributes] => Array ( [size] => 1 ) [0] => SimpleXMLElement Object ( [@attributes] => Array ( [baseRate] => 11.22 [rate] => 8.49 [promo] => true ) ) ) [Surcharges] => SimpleXMLElement Object ( [@attributes] => Array ( [size] => 2 ) [Surcharge] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [type] => ExtraPersonFee [amount] => 8.49 ) ) [1] => SimpleXMLElement Object ( [@attributes] => Array ( [type] => TaxAndServiceFee [amount] => 3.39 ) ) ) ) ) ) [ValueAdds] => SimpleXMLElement Object ( [@attributes] => Array ( [size] => 1 ) [ValueAdd] => SimpleXMLElement Object ( [@attributes] => Array ( [id] => 2048 ) [description] => Free Wireless Internet ) ) ) ) ) [3] => SimpleXMLElement Object ( [@attributes] => Array ( [order] => 3 ) [hotelId] => 394808 [name] => The Londonears Hostel [address1] => 1 Barkston Gardens [city] => London [postalCode] => SW5 0ER [countryCode] => GB [airportCode] => LHR [supplierType] => E [propertyCategory] => 5 [hotelRating] => 2.0 [confidenceRating] => 52 [amenityMask] => 0 [tripAdvisorRating] => 2.0 [locationDescription] => Near London Natural History Museum [shortDescription] => <p><b>Property Location</b> <br />With a stay at The Londonears Hostel, you'll be centrally located in London, convenient to Kensington Roof Gardens and Imperial College London. This hostel is close [highRate] => 10.45 [lowRate] => 10.45 [rateCurrencyCode] => GBP [latitude] => 51.49285 [longitude] => -0.18991 [proximityDistance] => 3.2764168 [proximityUnit] => MI [hotelInDestination] => true [thumbNailUrl] => /hotels/5000000/4700000/4694100/4694093/4694093_70_t.jpg [deepLink] => http://www.travelnow.com/templates/55505/hotels/394808/overview?lang=en&currency=GBP&standardCheckin=1/17/2016&standardCheckout=1/18/2016&roomsCount=1&rooms[0].adultsCount=2 [RoomRateDetailsList] => SimpleXMLElement Object ( [RoomRateDetails] => SimpleXMLElement Object ( [roomTypeCode] => 200134869 [rateCode] => 200753387 [maxRoomOccupancy] => 10 [quotedRoomOccupancy] => 1 [minGuestAge] => 0 [roomDescription] => Shared Dormitory, 1 Single Bed (10 Bed) [currentAllotment] => 13 [propertyAvailable] => true [propertyRestricted] => false [expediaPropertyId] => 4694093 [rateKey] => fd7fe5b5-f791-4375-857b-f418c7e39896 [RateInfo] => SimpleXMLElement Object ( [@attributes] => Array ( [priceBreakdown] => true [promo] => false [rateChange] => false ) [ChargeableRateInfo] => SimpleXMLElement Object ( [@attributes] => Array ( [averageBaseRate] => 8.71 [averageRate] => 8.71 [commissionableUsdTotal] => 15.57 [currencyCode] => GBP [maxNightlyRate] => 8.71 [nightlyRateTotal] => 8.71 [surchargeTotal] => 12.19 [total] => 20.90 ) [NightlyRatesPerRoom] => SimpleXMLElement Object ( [@attributes] => Array ( [size] => 1 ) [0] => SimpleXMLElement Object ( [@attributes] => Array ( [baseRate] => 8.71 [rate] => 8.71 [promo] => false ) ) ) [Surcharges] => SimpleXMLElement Object ( [@attributes] => Array ( [size] => 2 ) [Surcharge] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [type] => ExtraPersonFee [amount] => 10.45 ) ) [1] => SimpleXMLElement Object ( [@attributes] => Array ( [type] => TaxAndServiceFee [amount] => 1.74 ) ) ) ) ) ) ) ) ) [4] => SimpleXMLElement Object ( [@attributes] => Array ( [order] => 4 ) [hotelId] => 336155 [name] => Palmers Lodge Swiss Cottage - Hostel [address1] => 40 College Crescent [address2] => Swiss Cottage [city] => London [postalCode] => NW3 5LB [countryCode] => GB [airportCode] => LHR [supplierType] => E [propertyCategory] => 5 [hotelRating] => 2.0 [confidenceRating] => 52 [amenityMask] => 264 [tripAdvisorRating] => 4.0 [locationDescription] => In London (Hampstead) [shortDescription] => <p><b>Property Location</b> <br />With a stay at Palmers Lodge Swiss Cottage - Hostel in London (Hampstead), you'll be minutes from Swiss Cottage Farmers' Market and Hampstead Theatre. This hostel [highRate] => 30.0 [lowRate] => 24.0 [rateCurrencyCode] => GBP [latitude] => 51.54552 [longitude] => -0.1756 [proximityDistance] => 4.6696467 [proximityUnit] => MI [hotelInDestination] => true [thumbNailUrl] => /hotels/4000000/3130000/3125600/3125521/3125521_83_t.jpg [deepLink] => http://www.travelnow.com/templates/55505/hotels/336155/overview?lang=en&currency=GBP&standardCheckin=1/17/2016&standardCheckout=1/18/2016&roomsCount=1&rooms[0].adultsCount=2 [RoomRateDetailsList] => SimpleXMLElement Object ( [RoomRateDetails] => SimpleXMLElement Object ( [roomTypeCode] => 200145115 [rateCode] => 200813400 [maxRoomOccupancy] => 2 [quotedRoomOccupancy] => 2 [minGuestAge] => 0 [roomDescription] => Mixed Dorm (9 Double Bed) [promoId] => 213544183 [promoDescription] => Save 20% [currentAllotment] => 6 [propertyAvailable] => true [propertyRestricted] => false [expediaPropertyId] => 3125521 [rateKey] => 1ce0444e-0fc9-47c8-87b7-8641b184b173 [RateInfo] => SimpleXMLElement Object ( [@attributes] => Array ( [priceBreakdown] => true [promo] => true [rateChange] => false ) [ChargeableRateInfo] => SimpleXMLElement Object ( [@attributes] => Array ( [averageBaseRate] => 26.00 [averageRate] => 20.00 [commissionableUsdTotal] => 35.75 [currencyCode] => GBP [maxNightlyRate] => 20.00 [nightlyRateTotal] => 20.00 [surchargeTotal] => 4.00 [total] => 24.00 ) [NightlyRatesPerRoom] => SimpleXMLElement Object ( [@attributes] => Array ( [size] => 1 ) [0] => SimpleXMLElement Object ( [@attributes] => Array ( [baseRate] => 26.00 [rate] => 20.00 [promo] => true ) ) ) [Surcharges] => SimpleXMLElement Object ( [@attributes] => Array ( [size] => 1 ) [Surcharge] => SimpleXMLElement Object ( [@attributes] => Array ( [type] => TaxAndServiceFee [amount] => 4.00 ) ) ) ) ) [ValueAdds] => SimpleXMLElement Object ( [@attributes] => Array ( [size] => 1 ) [ValueAdd] => SimpleXMLElement Object ( [@attributes] => Array ( [id] => 2048 ) [description] => Free Wireless Internet ) ) ) ) ) ) ) ) 
SimpleXMLElement对象([customerSessionId]=>xxxxxxxx-6DB54xxxx[numberOfRoomsRequested]=>1[moreResultsAvailable]=>true[cacheKey]=>41ab978e:151c66db542:-446a[cacheLocation]=>10.186.170.129:7300[HotelList]=>SimpleXMLElement对象([@attributes]=>Array([size]=>5[ActiveCount]=>1253)[HotelSummary]=>Array]([0]=>SimpleXMLElement对象([@attributes]=>Array([order]=>0)[hotelId]=>402789[name]=>Venture Hostel[address1]=>86 Tanner's Hill[city]=>London[postalCode]=>SE8 4PN[countryCode]=>GB[airportCode]=>LHR[supplierType]=>E[Property Category]=>5[hotelRating]=>2.0[信任]=>52[修正任务]=>133120[tripAdvisorRating]=>3.0[locationDescription]=>In London(Lewisham)[shortDescription]=>酒店位置
入住伦敦风险旅馆(Lewisham),您将靠近格林威治市场和O2 Arena。该旅馆靠近卡蒂萨克和[highRate]=>8.36[Lowerate]=>8.36[rateCurrencyCode]=>GBP[纬度]=>51.47361[经度]=>-0.02712[近距离]=>3.9014914[近距离]=>MI[酒店目的地]=>true[缩略图URL]=>/hotels/5000000/4920000/4916900/4916812/4916812\u 41\u t.jpg[深度链接] => http://www.travelnow.com/templates/55505/hotels/402789/overview?lang=en¤cy=GBP&standardCheckin=1/17/2016&standardCheckout=1/18/2016&roomsCount=1&rooms[0].AdultScont=2[RoomRateDetailsList]=>SimpleXMLElement对象([RoomRateDetails]=>SimpleXMLElement对象([roomTypeCode]=>200585535[rateCode]=>20590877[MaxRoomOccupation]=>2[quotedRoomOccupancy]=>1[minGuestAge]=>0[roomDescription]=>共享宿舍、混合宿舍(8张床)[当前分配]=>12[propertyAvailable]=>true[propertyRestricted]=>false[ExpediPropertyId]=>4916812[rateKey]=>9b7dbc12-65ba-4a72-b9c0-f991e610f9ee[RateInfo]=>SimpleElement对象([@attributes]=>Array([priceBreakdown]=>true[promo]=>false[rateChange]=>false[ChargeRateInfo]=>SimpleXMLElement对象([@attributes]=>Array([averageBaseRate]=>8.36[averageRate]=>8.36[commissionableUsdTotal]=>12.45[currencyCode]=>GBP[MaxNightlyRateTotal]=>8.36[surchargeTotal]=>11.70[total]=>20.06)[NightLyratesErrorom]=>SimpleXMLElement对象([@attributes]=>Array([size]=>1)[0]=>SimpleXMLElement对象([@attributes]=>Array([@attributes]=>baseRate]=>8.36[rate]=>8.36[promo]=>false))[Surcharges]=>SimpleXMLElement对象([@attributes]=>Array([size]=>2)[附加费]=>Array([0]=>SimpleXMLElement对象([@attributes]=>Array([type]=>ExtraPersonFee[amount]=>8.36))[1]=>simplexmlement对象([@attributes]=>Array([type]=>TaxAndServiceFee[amount]=>3.34)))[ValueAdds]=>simplexmlement对象([@attributes]=>Array([size]=>2][ValueAdd]=>Array([0]=>simplexmlement对象([@attributes]=>Array([@attributes]=>Array[id]=>2048)[description]=>Free Wireless Internet][1]=>SimpleXMLElement对象([@attributes]=>Array([id]=>2][description]=>Continental早餐))))[1]=>SimpleXMLElement对象([@attributes]=>Array([@order]=>1)[hotelId]=>325381[name]=>639招待所[address1]=>639哈罗路[address2]=>Kensal Green[城市]=>伦敦[postalCode]=>NW10 5NU[countryCode]=>GB[airportCode]=>LCY[supplierType]=>E[propertyCategory]=>5[hotelRating]=>2.0[信任]=>52[AmentityMask]=>256[tripAdvisorRating]=>2.0[地点描述]=>伦敦(北伦敦)[简短描述]=>酒店位置
入住伦敦(北伦敦)639号旅舍,您将靠近波特贝罗路市场和皇家阿尔伯特大厅。该旅舍靠近伦敦帝国理工学院[高利率]=>9.77[低利率]=>8.47[利率代码]=>GBP[纬度]=>51.53012[经度]=>0.22551[近距离]=>5.5449877[proximityUnit]=>MI[hotelInDestination]=>true[thumbNailUrl]=>/hotels/3000000/2840000/2831600/2831521/2831521\u 73\u t.jpg[deepLink]=>http://www.travelnow.com/templates/55505/hotels/325381/overview?lang=en¤cy=GBP&standardCheckin=1/17/2016&standardCheckout=1/18/2016&roomsCount=1&rooms[0].AdultScont=2[RoomRateDetailsList]=>SimpleXMLElement对象([RoomRateDetails]=>SimpleXMLElement对象([roomTypeCode]=>200052408[rateCode]=>200307052[MaxRoomOccupation]=>8[quotedRoomOccupancy]=>0[minGuestAge]=>18[roomDescription]=>共享宿舍、混合宿舍(8张床)[promoId]=>214239009[promoDescription]=>节省13%[CurrentAllocation]=>75[propertyAvailable]=>true[propertyRestricted]=>false[ExpediPropertyId]=>2831521[rateKey]=>57c8780b-2a50-45ff-8f0a-bb08622f071e[RateInfo]=>SimpleXMLElement对象([@attributes]=>Array([priceBreakdown]=>true[promo]=>true[rateChange]=>false)[ChargeableRateInfo]=>SimpleXMLElement对象([@attributes]=>Array([averageBaseRate]=>9.77[averageRate]=>8.47[commissionableUsdTotal]=>12.62[currencyCode]=>GBP[maxNightlyRate]=>8.47[nightlyRateTotal]=>8.47[surchargeTotal]=>11.86[total]=>20.33[NightlyRatesPerRoom]=>SimpleXMLElement对象([@attributes]=>Array([size]=>1)
$XML = "&xml=<HotelListRequest><city>$citysearch</city><currencyCode>£</currencyCode><arrivalDate>01/17/2016</arrivalDate><departureDate>01/18/2016</departureDate><supplierType>E</supplierType><RoomGroup><Room><numberOfAdults>$noaddults</numberOfAdults><numberOfChildren>$nochildren</numberOfChildren></Room></RoomGroup><numberOfResults>5</numberOfResults><locale>en_US</locale><sort>PRICE</sort></HotelListRequest>";

// Sending Request to API

$header[] = "Accept: application/xml";
$ch = curl_init();
curl_setopt( $ch, CURLOPT_HTTPHEADER, $header );
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch,CURLOPT_POST,5);
curl_setopt($ch,CURLOPT_POSTFIELDS,$XML);
curl_setopt( $ch, CURLOPT_URL, $url.$XML );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
$response = curl_exec($ch);
$response = simplexml_load_string($response);

// to get the  customerSessionId xxxxxxxx-6DB54xxxx
echo "sessionID: " . $response->customerSessionId;

// to get the HotelList
print_r($response->HotelList);

// loop over the HotelList:
foreach ($response->HotelList as $hotel) {
    // do sth. useful with the hotel
    // e.g. build a pool or whatever ;-)
}