how to fetch value from rest webservice xml response .

how to fetch value from rest webservice xml response .

by Nihar Das -
Number of replies: 0
to get an array i have passed the xml response in to one function i.e
                      $xml = simplexml_load_string($resp);
if i will dump $xml it is giving me an array which is

SimpleXMLElement Object
(
    [SINGLE] => SimpleXMLElement Object
        (
            [KEY] => Array
                (
                    [0] => SimpleXMLElement Object
                        (
                            [@attributes] => Array
                                (
                                    [name] => id
                                )

                            [VALUE] => 2
                        )

                    [1] => SimpleXMLElement Object
                        (
                            [@attributes] => Array
                                (
                                    [name] => username
                                )

                            [VALUE] => admin
                        )

                    [2] => SimpleXMLElement Object
                        (
                            [@attributes] => Array
                                (
                                    [name] => password
                                )

                            [VALUE] => $2y$10$7M7tcqJDwqmKZRenKGyB8.SYLMkErOSRgrLDd/bxDCBMJyVpTMKlO
                        )

                    [3] => SimpleXMLElement Object
                        (
                            [@attributes] => Array
                                (
                                    [name] => firstname
                                )

                            [VALUE] => Admin
                        )

                    [4] => SimpleXMLElement Object
                        (
                            [@attributes] => Array
                                (
                                    [name] => lastname
                                )

                            [VALUE] => User
                        )

                    [5] => SimpleXMLElement Object
                        (
                            [@attributes] => Array
                                (
                                    [name] => email
                                )

                            [VALUE] => nihar.cbsh@gmail.com
                        )

                    [6] => SimpleXMLElement Object
                        (
                            [@attributes] => Array
                                (
                                    [name] => skype
                                )

                            [VALUE] => SimpleXMLElement Object
                                (
                                )

                        )

                    [7] => SimpleXMLElement Object
                        (
                            [@attributes] => Array
                                (
                                    [name] => phone
                                )

                            [VALUE] => SimpleXMLElement Object
                                (
                                    [@attributes] => Array
                                        (
                                            [null] => null
                                        )

                                )

                        )

                    [8] => SimpleXMLElement Object
                        (
                            [@attributes] => Array
                                (
                                    [name] => city
                                )

                            [VALUE] => SimpleXMLElement Object
                                (
                                )

                        )

                    [9] => SimpleXMLElement Object
                        (
                            [@attributes] => Array
                                (
                                    [name] => country
                                )

                            [VALUE] => SimpleXMLElement Object
                                (
                                )

                        )

                    [10] => SimpleXMLElement Object
                        (
                            [@attributes] => Array
                                (
                                    [name] => lang
                                )

                            [VALUE] => en
                        )

                    [11] => SimpleXMLElement Object
                        (
                            [@attributes] => Array
                                (
                                    [name] => avatar
                                )

                            [VALUE] => SimpleXMLElement Object
                                (
                                    [@attributes] => Array
                                        (
                                            [null] => null
                                        )

                                )

                        )

                    [12] => SimpleXMLElement Object
                        (
                            [@attributes] => Array
                                (
                                    [name] => timemodified
                                )

                            [VALUE] => 1401344604
                        )

                )

        )

)
from this array how can i fetch value of each element????
Average of ratings: -