how to store xml data in array (php)
Posted
by tommy
on Stack Overflow
See other posts from Stack Overflow
or by tommy
Published on 2010-04-06T08:40:01Z
Indexed on
2010/04/06
8:43 UTC
Read the original article
Hit count: 358
<?xml version="1.0" encoding="UTF-8" ?>
- <response xmlns:lf="http://api.lemonfree.com/ns/1.0">
<lf:request_type>listing</lf:request_type>
<lf:response_code>0</lf:response_code>
- <lf:result type="listing" count="10">
- <lf:item id="56832429">
<lf:attr name="title">Used 2005 Ford Mustang V6 Deluxe</lf:attr>
<lf:attr name="year">2005</lf:attr>
<lf:attr name="make">FORD</lf:attr>
<lf:attr name="model">MUSTANG</lf:attr>
<lf:attr name="vin">1ZVFT80N555169501</lf:attr>
<lf:attr name="price">12987</lf:attr>
<lf:attr name="mileage">42242</lf:attr>
<lf:attr name="auction">no</lf:attr>
<lf:attr name="city">Grand Rapids</lf:attr>
<lf:attr name="state">Michigan</lf:attr>
<lf:attr name="image">http://www.lemonfree.com/images/stock_images/thumbnails/2005_38_557_80.jpg</lf:attr>
<lf:attr name="link">http://www.lemonfree.com/56832429.html</lf:attr>
</lf:item>
Above is the xml i am working with - there are more items - this is the first set. How can i get these elements in to an array. I have been trying with php's simple xml etc but i just cant do it.
Thanks guys
© Stack Overflow or respective owner