How to get element value of xml in php array?



My XML Response look like this:



<Items>
<Item>
<ImageSets>
<ImageSet Category="Primary">
<SwatchImage>
<URL>http://ift.tt/1uWLpYf;
<Height Units="pixels">30</Height>
</SwatchImage>
</ImageSet>

<ImageSet Category="Variant">
<SwatchImage>
<URL>http://ift.tt/1qH1fj9;
<Height Units="pixels">30</Height>
</SwatchImage>
</ImageSet>

<ImageSet Category="Variant">
<SwatchImage>
<URL>http://ift.tt/1uWLo6s;
<Height Units="pixels">30</Height>
</SwatchImage>
</ImageSet>

</ImageSets>
</Item>
</Items>


Now, How can i get each value of (URL) if there is more than one category??


I need to save all URL in an array, the one that is in primary and all that are in variant. thanks :)


No comments:

Post a Comment