How to extract tags from XML

Posted by uku on Stack Overflow See other posts from Stack Overflow or by uku
Published on 2010-03-08T20:18:54Z Indexed on 2010/03/08 20:21 UTC
Read the original article Hit count: 211

Filed under:
|

Hi,

I have a simple XML extraction issue that should be solvable with straight PHP and not require any libraries.

All I need to do is extract the values of one tag. For example, given the string of XML:

<ResultSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ....>
 <Result>Foo</Result>
 <Result>Bar</Result>
</ResultSet>

I just need to put Foo and Bar in an array. What is the easiest way to do this?

Thanks!

© Stack Overflow or respective owner

Related posts about php

Related posts about Xml