XML Grouping


Posted on 16th Feb 2014 07:03 pm by admin

I'm using xml_parse_into_struct to get all my elements, but now I need to group them. For example, here's the XML

<categories>
<category id="12345">
<title>category title 1</title>
<tips>
<tip id="0">
<title>hello world</title>
<content>some content</content>
</tip>
<tip id="1">
<title>foo</title>
<content>foo content</content>
</tip>
</tips>
</category>
<category id="7890">
<title> category title 2</title>
<tips>
<tip id="2">
<title>another tip title</title>
<content>blah blah</content>
</tip>
<tip id="3">
<title>another tip title</title>
<content>blah blah</content>
</tip>

</tips>
</category>
</categories>


How would I just grab the tip titles for the 2nd category (7890)? Hope I'm making sense.
I can loop through the array using foreach, but have no way to determine if a tip belongs to the 1st or 2nd category. Ideas??

Please help!

Thanks

No comments posted yet

Your Answer:

Login to answer
170 Like 5 Dislike
Previous forums Next forums
Other forums

Linked Keywords
I am trying to get a script that makes my predefined keyword converted to links and / or converted t

I need desperate help with this php code integrated with flash please
Can someone please help me with this php code which I have been stuck on for weeks . I am trying to

Socket Server
In my following socket server, I am trying to listen to a connection through port 12345 in my web br

need to apply an if/else statement to Tim Thumb script
Not sure how to work this. I essentially want to call a variety of image sizes based on which style

Need help with basic sql
Hi,

I am using oracle 10g, and having some small doubts related to sql , here goes the si

IP Logger for Voting Script
Can anybody help me place an IP logger into my voting script?
I know that maybe it is not as secu

Help: calling function
Hi,
Is it possible to call a php function on page close?
If yes, could you explain how and whe

Not sure why this script is not working?
Hi I am new to php programing and I was trying to make up a simple script like a captcha but I canno

Data Function is Its Not working IN IE8
This is my first time to use formums. I hope i can get solution for this problem. view plaincopy to

animation progress while uploading files?
Hello, i have some website form to upload few files to server. i want to put some gif animation whi

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash