2011-07-07 32 views
0

我們可以將此xml響應更改爲數組。請幫幫我。如何使用php在curl xml響應中顯示值?

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
<soapenv:Body> 
     <ns1:OTA_HotelAvailRQResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://components.hotelsv3"> 
      <OTA_HotelAvailRQReturn xsi:type="xsd:string"><?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?> 
       <OTA_HotelAvailRS Version=&quot;1.0&quot;> 
        <Success Id=&quot;141334&quot;/> 

        <Properties> 

          <Property HotelCityCode=&quot;ELS&quot; HotelCode=&quot;26824&quot; HotelName=&quot;Premier Hotel Regent - Demo&quot;> 
            <RelativePosition Direction=&quot;&quot; Distance=&quot;0&quot; DistanceUnitName=&quot;&quot;/> 

           <EssentialInfo> 

           </EssentialInfo> 
           <RoomStays> 

            <RoomStay> 
             <RatePlans> 
               <RatePlan RatePlanCode=&quot;71316&quot;/> 

             </RatePlans> 
             <RoomRates> 
               <RoomRate> 
                <Rates> 
                 <Rate EffectiveDate=&quot;2011-10-14&quot; ExpireDate=&quot;2011-10-15&quot;> 

                  <Base Amount=&quot;114.00&quot; CurrencyCode=&quot;EUR&quot;/> 
                  <RateDescription Adults=&quot;1&quot; Availability=&quot;A&quot; Children=&quot;0&quot; RoomNum=&quot;1&quot;> 

                    Standard 
                  </RateDescription> 
                 </Rate> 
                </Rates> 
               </RoomRate> 
             </RoomRates> 

             <Meals Description=&quot;Breakfast Buffet&quot; MealType=&quot;Breakfast&quot;/> 


              </RoomStay> 

           </RoomStays> 
           <Promotions/> 

           <AdditionalInfo> 
            <HotelStarDetail rating=&quot;3&quot;/> 


            <HotelImages> 

             <HotelImage Type=&quot;&quot; URL=&quot;http://image1.urlforimages.com/1204258/Premier-Hotel-Regent_guest.jpg&quot;/> 

               </HotelImages> 

            <HotelDescription> 
             <LongDescription> guest rooms 175 guestrooms</LongDescription> 

            </HotelDescription> 
           </AdditionalInfo> 

          </Property> 

          <Property HotelCityCode=&quot;ELS&quot; HotelCode=&quot;26823&quot; HotelName=&quot;Mpongo Private Game Reserve - Demo&quot;> 

            <RelativePosition Direction=&quot;&quot; Distance=&quot;0&quot; DistanceUnitName=&quot;&quot;/> 
           <EssentialInfo> 

           </EssentialInfo> 
           <RoomStays> 


            <RoomStay> 
             <RatePlans> 
               <RatePlan RatePlanCode=&quot;71314&quot;/> 
             </RatePlans> 
             <RoomRates> 

               <RoomRate> 
                <Rates> 
                 <Rate EffectiveDate=&quot;2011-10-14&quot; ExpireDate=&quot;2011-10-15&quot;> 
                  <Base Amount=&quot;117.00&quot; CurrencyCode=&quot;EUR&quot;/> 

                  <RateDescription Adults=&quot;1&quot; Availability=&quot;A&quot; Children=&quot;0&quot; RoomNum=&quot;1&quot;> 
                    Standard 
                  </RateDescription> 

                 </Rate> 
                </Rates> 
               </RoomRate> 
             </RoomRates> 

             <Meals Description=&quot;Half board&quot; MealType=&quot;HalfBoard&quot;/> 


              </RoomStay> 

            <RoomStay> 
             <RatePlans> 
               <RatePlan RatePlanCode=&quot;71315&quot;/> 
             </RatePlans> 

             <RoomRates> 
               <RoomRate> 
                <Rates> 
                 <Rate EffectiveDate=&quot;2011-10-14&quot; ExpireDate=&quot;2011-10-15&quot;> 
                  <Base Amount=&quot;174.00&quot; CurrencyCode=&quot;EUR&quot;/> 

                  <RateDescription Adults=&quot;1&quot; Availability=&quot;A&quot; Children=&quot;0&quot; RoomNum=&quot;1&quot;> 
                    River Lodge 
                  </RateDescription> 

                 </Rate> 
                </Rates> 
               </RoomRate> 
             </RoomRates> 

             <Meals Description=&quot;Half board&quot; MealType=&quot;HalfBoard&quot;/> 


              </RoomStay> 

           </RoomStays> 
           <Promotions/> 

           <AdditionalInfo> 
            <HotelStarDetail rating=&quot;4&quot;/> 


            <HotelImages> 

             <HotelImage Type=&quot;&quot; URL=&quot;http://image1.urlforimages.com/1204253/Mpongo-Private_guest.jpg&quot;/> 

               </HotelImages> 

            <HotelDescription> 
             <LongDescription> Accommodation: 18 guestrooms</LongDescription> 

            </HotelDescription> 
           </AdditionalInfo> 

          </Property> 
        </Properties> 
      </OTA_HotelAvailRS></OTA_HotelAvailRQReturn> 
     </ns1:OTA_HotelAvailRQResponse> 

</soapenv:Body> 

回答