Jump to content

Problem using SimpleXML


dezkit

Recommended Posts

Hey guys I have the following code:

 

$xml = new SimpleXMLElement( 'http://steamcommunity.com/profiles/76561197963859775?xml=1' , NULL, TRUE );
			print_r($xml);

The problem here is that it doesnt echo everything correctly...

It doesn't show avatarFull for me

impleXMLElement Object
(
    [steamID64] => 76561197961308838
    [steamID] => SimpleXMLElement Object
        (
        )

    [onlineState] => in-game
    [stateMessage] => SimpleXMLElement Object
        (
        )

    [privacyState] => public
    [visibilityState] => 3
    [avatarIcon] => SimpleXMLElement Object
        (
        )

    [avatarMedium] => SimpleXMLElement Object
        (
        )

    [avatarFull] => SimpleXMLElement Object
        (
        )

 

That's what it shows, the avatarFull and a couple others are empty.

How do I fix this? Thank you

Link to comment
https://forums.phpfreaks.com/topic/212327-problem-using-simplexml/
Share on other sites

Have you tried echoing them out..?

 

echo $xml->avatarMedium;

 

I think the reason you're unable to see them with print_r() is because they're classed as SimpleXMLElement objects too; which print_r() doesn't seem to be able to recursively print through.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.