Hello I have the xml that i have attached. I need to parse it with php
- Get the hotel details in area name that i get from the URL for example XX.com/london.
I will get the london name and the hotel details in array(there is lot of hotels) or something else.
- some of the data is in CDATA - how can I parse it ?
How can I do those issues in PHP ?
<?xml version="1.0" encoding="UTF-8"?>
<root>
<description>
<![CDATA[Hotels list]]>
</description>
<area>
<name>London</name>
<hotel>
<name>hotel1</name>
<hotel_desc>
<![CDATA[]]>
</hotel_desc>
<hotel_picture>
<![CDATA[pic1]]>
</hotel_picture>
<stars>
<![CDATA[4]]>
</stars>
</hotel>
<hotel>
<name>hotel2</name>
<hotel_desc>
<![CDATA[desc
]]>
</hotel_desc>
<hotel_picture>
<![CDATA[pic.jpg]]>
</hotel_picture>
<stars>
<![CDATA[5]]>
</stars>
</hotel>
</area>
</root>
Aucun commentaire:
Enregistrer un commentaire