[PHP]Extracting specific data from XML

Newbie Spellweaver
Joined
Jan 28, 2007
Messages
62
Reaction score
0
Hello, I've been trying to figure this out for a while now (been searching, didn't find much).

I'd like to know how to extract and echo specific data from a external XML file.

Here's what I want to do:

Code:
<item>
            <title></title>
            <link></link>
            <description></description>
            <category domain="status"></category>
            <category domain="language"></category>
            <category domain="type"></category>
            
            <category domain="queue"></category>
            <guid isPermaLink='false'></guid>
</item>

I want to extract title, link, category domain="status", category domain="language", category domain="type", category domain="queue". And only items that contain a specific title.

I've found out how to get category, but then I'll only get the first one (status).

Thanks in advance!
 
Last edited:
I've searched around alot, I can get the whole XML.
I guess I might've been a bit unclear, all I need to know is how to filter the rest out.
 
Thanks a lot for the replies. I'll try it out.

EDIT: Alright, it confuses me a bit on how to work with it as what I've got uses "$xml = file_get_contents", but I'm not quite sure if that matters.

Note, yes, I am new to this. But would like to learn by getting it to work.
 
Last edited:
Back