Parse XML: Get child nodes for each parent node



I tried a lot of different solutions but I'm just new at this..


I have an xml tree like this:


<book> <author> Firs author </author> <title> aaaa </title> <price> 111 </price> </book> <book> <author> Second author </author> <title> bbbb </title> <price> 222 </price> </book> <book> <author> Third author </author> <title> cccc </title> <price> 333 </price> </book>


I need to parse it in my php code to obtain a table such as



First author,
aaaa,
111

Second author,
bbbb,
222

Third author,
cccc,
333`


Is it possible? Really thank you.


No comments:

Post a Comment