Page 1 of 1

Process XML Data with PHP...?

Posted: Wed Nov 29, 2006 5:08 pm
by ansa
Hi,

How can we process XML data using PHP so we can show only the requested data, or if it is possible at all?

For example, I have the following XML:

Code: Select all

<book>
   <title>some title A</title>
   <author>john doe</author>
   <year>1995</year>
</book>
<book>
   <title>some title B</title>
   <author>jAlan Smith</author>
   <year>2000</year>
</book>
...
Let's say, I only want to display the books that are published in 1995 (year tag).

Any suggestions? Maybe using other language, say CSS?

Thanks!

Posted: Wed Nov 29, 2006 7:41 pm
by aaronhall
Here's the part of the manual the covers the XML parser extension: http://us2.php.net/xml

And here are some links to tutorials to help you get started:
http://www.evilwalrus.org/tags/articles/xml
http://www.tutorialized.com/tutorials/PHP/XML-and-PHP/1