Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Dec 2008
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how i can explode this xml file in php

    i want to explode this xml file in php and i dont know how to get the value on each node


    <?xml version="1.0"?>
    <HotelSearchRS>
    <Response>
    <item>
    <id>124786</id>
    <bestPrice AllocationKey="20140602-034842" currency="INR" amount="0">
    <availableRoom ourAmount="8934.44" ourCurrency="INR" BookingKey="124786-1"/>
    </bestPrice>
    <availableRooms>
    <availableRoom AllocationKey="20140602-034842" hotelID="124786" ourAmount="8934.44" ourCurrency="INR" hotelCategory="5" isRecommended="" hotelName="Le Meridien Dahab Resort" location="Near Dahab Bay" meals="Full Breakfast" BookingKey="124786-1" totalRooms="1" totalRoomTypes="1" roomName="Superior Room" availablity="AVAILABLE" offers="" essentialInformation="" rooms="SB:0-SBWC:0-SBW2C:0-DB:0-DBWC:1-DBW2C:0-TR:0-TRWC:0-TRW2C:0-QB:0-QBWC:0-QBW2C:0"/>
    <availableRoom AllocationKey="20140602-034842" hotelID="124786" ourAmount="12507.1" ourCurrency="INR" hotelCategory="5" isRecommended="" hotelName="Le Meridien Dahab Resort" location="Near Dahab Bay" meals="Full Breakfast" BookingKey="124786-2" totalRooms="1" totalRoomTypes="1" roomName="Deluxe Room" availablity="AVAILABLE" offers="" essentialInformation="" rooms="SB:0-SBWC:0-SBW2C:0-DB:0-DBWC:1-DBW2C:0-TR:0-TRWC:0-TRW2C:0-QB:0-QBWC:0-QBW2C:0"/>
    <availableRoom AllocationKey="20140602-034842" hotelID="124786" ourAmount="12763.43" ourCurrency="INR" hotelCategory="5" isRecommended="" hotelName="Le Meridien Dahab Resort" location="Near Dahab Bay" meals="Full Breakfast" BookingKey="124786-3" totalRooms="1" totalRoomTypes="1" roomName="Superior Room" availablity="AVAILABLE" offers="" essentialInformation="" rooms="SB:0-SBWC:0-SBW2C:0-DB:0-DBWC:1-DBW2C:0-TR:0-TRWC:0-TRW2C:0-QB:0-QBWC:0-QBW2C:0"/>
    <availableRoom AllocationKey="20140602-034842" hotelID="124786" ourAmount="17016.91" ourCurrency="INR" hotelCategory="5" isRecommended="" hotelName="Le Meridien Dahab Resort" location="Near Dahab Bay" meals="Full Breakfast" BookingKey="124786-4" totalRooms="1" totalRoomTypes="1" roomName="Superior Room" availablity="AVAILABLE" offers="" essentialInformation="" rooms="SB:0-SBWC:0-SBW2C:0-DB:0-DBWC:1-DBW2C:0-TR:0-TRWC:0-TRW2C:0-QB:0-QBWC:0-QBW2C:0"/>
    <availableRoom AllocationKey="20140602-034842" hotelID="124786" ourAmount="17867.7" ourCurrency="INR" hotelCategory="5" isRecommended="" hotelName="Le Meridien Dahab Resort" location="Near Dahab Bay" meals="Full Breakfast" BookingKey="124786-5" totalRooms="1" totalRoomTypes="1" roomName="Deluxe Room" availablity="AVAILABLE" offers="" essentialInformation="" rooms="SB:0-SBWC:0-SBW2C:0-DB:0-DBWC:1-DBW2C:0-TR:0-TRWC:0-TRW2C:0-QB:0-QBWC:0-QBW2C:0"/>
    <availableRoom AllocationKey="20140602-034842" hotelID="124786" ourAmount="22688.8" ourCurrency="INR" hotelCategory="5" isRecommended="" hotelName="Le Meridien Dahab Resort" location="Near Dahab Bay" meals="Full Breakfast" BookingKey="124786-6" totalRooms="1" totalRoomTypes="1" roomName="Deluxe Room" availablity="AVAILABLE" offers="" essentialInformation="" rooms="SB:0-SBWC:0-SBW2C:0-DB:0-DBWC:1-DBW2C:0-TR:0-TRWC:0-TRW2C:0-QB:0-QBWC:0-QBW2C:0"/>
    <availableRoom AllocationKey="20140602-034842" hotelID="124786" ourAmount="31269.08" ourCurrency="INR" hotelCategory="5" isRecommended="" hotelName="Le Meridien Dahab Resort" location="Near Dahab Bay" meals="Full Breakfast" BookingKey="124786-7" totalRooms="1" totalRoomTypes="1" roomName="Suite" availablity="AVAILABLE" offers="" essentialInformation="" rooms="SB:0-SBWC:0-SBW2C:0-DB:0-DBWC:1-DBW2C:0-TR:0-TRWC:0-TRW2C:0-QB:0-QBWC:0-QBW2C:0"/>
    <availableRoom AllocationKey="20140602-034842" hotelID="124786" ourAmount="44669.85" ourCurrency="INR" hotelCategory="5" isRecommended="" hotelName="Le Meridien Dahab Resort" location="Near Dahab Bay" meals="Full Breakfast" BookingKey="124786-8" totalRooms="1" totalRoomTypes="1" roomName="Suite" availablity="AVAILABLE" offers="" essentialInformation="" rooms="SB:0-SBWC:0-SBW2C:0-DB:0-DBWC:1-DBW2C:0-TR:0-TRWC:0-TRW2C:0-QB:0-QBWC:0-QBW2C:0"/>
    <availableRoom AllocationKey="20140602-034842" hotelID="124786" ourAmount="52469.1" ourCurrency="INR" hotelCategory="5" isRecommended="" hotelName="Le Meridien Dahab Resort" location="Near Dahab Bay" meals="Full Breakfast" BookingKey="124786-9" totalRooms="1" totalRoomTypes="1" roomName="Suite" availablity="AVAILABLE" offers="" essentialInformation="" rooms="SB:0-SBWC:0-SBW2C:0-DB:0-DBWC:1-DBW2C:0-TR:0-TRWC:0-TRW2C:0-QB:0-QBWC:0-QBW2C:0"/>
    </availableRooms>
    </item>
    </Response>
    </HotelSearchRS>

    like AllocationKey, hotel id, hotel name etc...

  • #2
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,235
    Thanks
    10
    Thanked 270 Times in 269 Posts
    Here's the SimpleXML doc - PHP: SimpleXML - Manual

  • #3
    Regular Coder
    Join Date
    Dec 2008
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by tracknut View Post
    Here's the SimpleXML doc - PHP: SimpleXML - Manual


    dear i can not till now explort this huge xml file.. any help please

  • #4
    New Coder
    Join Date
    Jun 2005
    Location
    Blackpool. UK
    Posts
    98
    Thanks
    0
    Thanked 4 Times in 4 Posts
    You have the manual, .... .... Start reading it.
    Chris

    Indifference will be the downfall of mankind, but who cares?

  • #5
    New Coder
    Join Date
    Jun 2005
    Location
    Blackpool. UK
    Posts
    98
    Thanks
    0
    Thanked 4 Times in 4 Posts
    Or .... Hire somebody to code it for you.
    Last edited by chrishirst; 06-03-2014 at 11:00 AM.
    Chris

    Indifference will be the downfall of mankind, but who cares?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •