0

I have a XML which I parse with php simpleXML.

The XML:

<GetOneGetAll DateTimeSystem="28-06-2011 17:19:29" RetCode="200" RetVal="1" RetMsg="User ok.">
    <User Id="bc5cb4cf-19a6-4504-8e1a-f72dd97bcc66" ReferedConfirmedUsers="0" TotalRecomendations="0" DistinctRecomendations="0">
        <Name>Name</Name>
        <Surname>Surname</Surname>
        <Gender>F</Gender>
        <Email>[email protected]</Email>
        <RefererCode>59286904</RefererCode>
        <CustomPhotoMessage HasCustomPhoto="0" HasCustomMessage="0"/>   
        <ReferedConfirmedUsersList/>
    </User>
</GetOneGetAll>

When I print_r the var using simpleXML I get:

SimpleXMLElement Object
(
    [@attributes] => Array
        (
            [DateTimeSystem] => 28-06-2011 17:22:52
            [RetCode] => 200
            [RetVal] => 1
            [RetMsg] => Login ok.
        )

    [User] => SimpleXMLElement Object
        (
            [@attributes] => Array
                (
                    [Id] => bc5cb4cf-19a6-4504-8e1a-f72dd97bcc66
                    [ReferedConfirmedUsers] => 0
                    [TotalRecomendations] => 0
                    [DistinctRecomendations] => 0
                )

            [Name] => SimpleXMLElement Object
                (
                )

            [Surname] => SimpleXMLElement Object
                (
                )

            [Gender] => SimpleXMLElement Object
                (
                )

            [Email] => SimpleXMLElement Object
                (
                )

            [RefererCode] => SimpleXMLElement Object
                (
                )

            [CustomPhotoMessage] => SimpleXMLElement Object
                (
                    [@attributes] => Array
                        (
                            [HasCustomPhoto] => 0
                            [HasCustomMessage] => 0
                        )

                )

            [ReferedConfirmedUsersList] => SimpleXMLElement Object
                (
                )
        )
)

Where is the data of Surname, Name, Email, Gender, etc.?

2
  • It loads fine for me. Are you displaying this through a web page, or CLI? Can you access the data and just not print_r it, or is the data not there through $xml_obj->User->Surname either?
    – ben
    Jun 28, 2011 at 16:47
  • Yes, it seems it's there, ican access it ... but doesn't show on the print_r.
    – AFRC
    Jul 2, 2011 at 17:58

1 Answer 1

0

This is just a guess, but if you have xdebug installed, then the default recursion level of var_dump output is 3. This setting is xdebug.var_display_max_depth You are using print_r, but some similar recursive limit could be being reached.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.