Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6125363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:14:20+00:00 2026-05-23T16:14:20+00:00

I am using curl in my project. When i am sending request, the response

  • 0

I am using curl in my project. When i am sending request, the response is coming in the form of XML as bellow. How can i convert this xml into array to present in the web page.

 <?xml version="1.0" encoding="UTF-8"?>
    <OTA_HotelAvailRS Version="1.0">
      <Success Id="140948"/>
       <Properties>
         <Property HotelCityCode="ELS" HotelCode="18918" HotelName="Premier Hotel Regent - Demo">
           <RelativePosition Direction="" Distance="0" DistanceUnitName=""/>
           <EssentialInfo>
           </EssentialInfo>
           <RoomStays>
                <RoomStay>
                     <RatePlans>
                          <RatePlan RatePlanCode="50010"/>
                     </RatePlans>
                     <RoomRates>
                          <RoomRate>
                               <Rates>
                                    <Rate EffectiveDate="2011-10-14" ExpireDate="2011-10-15">
                                         <Base Amount="114.00" CurrencyCode="EUR"/>

                                         <RateDescription Adults="1" Availability="A" Children="0" RoomNum="1">
                                              Standard
                                         </RateDescription>
                                    </Rate>
                               </Rates>
                          </RoomRate>
                     </RoomRates>
                     <Meals Description="Breakfast Buffet" MealType="Breakfast"/>
                </RoomStay>
           </RoomStays>
           <Promotions/>
           <AdditionalInfo>
                <HotelStarDetail rating="3"/>
                <HotelImages>
                     <HotelImage Type="" URL="http://image1.urlforimages.com/1204258guest.jpg"/>
                </HotelImages>
                <HotelDescription>
                     <LongDescription> description</LongDescription>
                </HotelDescription>
           </AdditionalInfo>
      </Property>          
 </Properties>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:14:20+00:00Added an answer on May 23, 2026 at 4:14 pm

    Why convert it to an array at all? PHP is pretty good with XML. Just load up the XML in SimpleXML or a DOMDocument and use it directly.

    $xml = new SimpleXMLElement($response);
    echo $xml->properties->property['HotelName'];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using cURL to get the XML file for my Twitter friend's timeline. (API
I'm using CURL to connect to multiple xml feeds and process them when the
I am using curl like this: curl -s -F uploaded_file=@/path_to_file;type=text/html -F output=soap12 http://localhost/w3c-markup-validator/check >text.xml
I'm using curl to make php send an http request to some website somewhere
I was working on a project for which i was using curl to fetch
So I've been looking into using google base for a clients job listing project.
There's a sample ASP.NET project with this controller: using System; using System.Collections.Generic; using System.Web;
When using Curl from the command line you can use the following command to
I have been using Curl for making network calls and I can use the
I am using PHP / curl to get a HTML into a string and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.