extracting array elements

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
smilesmita
Forum Commoner
Posts: 30
Joined: Thu May 24, 2007 1:52 pm

extracting array elements

Post by smilesmita »

hi there,
this is a kind of array i get after i have parsed my xml.
now i wanted to extract data from this array:
name and cdata elements needs to be extracted.any ideas?

Code: Select all

[2] => Array
        (
            [name] => DELIVERY
            [attrs] => Array
                (
                )

            [children] => Array
                (
                    [0] => Array
                        (
                            [name] => PACKAGEREFERENCENUMBER
                            [attrs] => Array
                                (
                                )

                            [children] => Array
                                (
                                    [0] => Array
                                        (
                                            [name] => CODE
                                            [attrs] => Array
                                                (
                                                )

                                            [cdata] => IK
                                        )

                                    [1] => Array
                                        (
                                            [name] => VALUE
                                            [attrs] => Array
                                                (
                                                )

                                            [cdata] => 66759
                                        )

                                )

                        )



hawleyjr | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Post Reply