Process XML Data with PHP...?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ansa
Forum Commoner
Posts: 31
Joined: Tue Aug 29, 2006 1:58 am
Location: Hamburg, Germany

Process XML Data with PHP...?

Post 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!
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Post 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
Post Reply