User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 423,548 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,934 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 4322 | Replies: 0
Join Date: Jul 2006
Posts: 12
Reputation: balagod is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
balagod balagod is offline Offline
Newbie Poster

Question multi dimensional array search xml parser

  #1  
Jul 20th, 2006
Hai,
I got xml parser to read xml file the output is like multi dimensional array ,i want to search particular id and get that matched id details from that array if the element have child to read child array also
I give one example here

<map>
<page id="home" name="Home" content="home.xml" template="home.php" bar="home_bar.xml"/>
<page id="training" name="Training" content="training.xml" template="text.php" bar="training_bar.xml">
<page id="training-trainings" name="Trainings" content="training-trainings.xml" template="text.php" bar="training_bar.xml"/>
<page id="training-workshops" name="Workshops" content="training-workshops.xml" template="text.php" bar="training_bar.xml"/>
</page>
</map>

If i give search id ="training"
The out put is the values in
id="training"
name="Training"
content="training.xml"
template="text.php"
bar="training_bar.xml"

2.If i give search id ="home"
The out put is the values in
id="home"
name="Home"
content="home.xml"
template="home.php"
bar="home_bar.xml"

and child nodes values are need
id="training"
name="Training"
content="training.xml"
template="text.php"
bar="training_bar.xml"

2nd child
id="training-trainings"
name="Trainings"
content="training-trainings.xml"
template="text.php"
bar="training_bar.xml"
<page id="training-workshops" name="Workshops" content="training-workshops.xml" template="text.php" bar="training_bar.xml"/>

My Xml parser out put is like this
Array
(
[map] => Array
(
[page] => Array
(
[0] => Array
(
[id] => home
[name] => Home
[content] => home.xml
[template] => home.php
[bar] => home_bar.xml
[value] =>
)

[1] => Array
(
[page] => Array
(
[0] => Array
(
[id] => training-trainings
[name] => Trainings
[content] => training-trainings.xml
[template] => text.php
[bar] => training_bar.xml
[value] =>
)

[1] => Array
(
[id] => training-workshops
[name] => Workshops
[content] => training-workshops.xml
[template] => text.php
[bar] => training_bar.xml
[value] =>
)

)

[id] => training
[name] => Training
[content] => training.xml
[template] => text.php
[bar] => training_bar.xml
[value] =>
)

)

[value] =>
)

)



Any Expert help me

Thanks
Bala
AddThis Social Bookmark Button
Reply With Quote  

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 6:04 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC