Accessing a numeric property in a SimpleXMLElement

Posted by Webnet on Stack Overflow See other posts from Stack Overflow or by Webnet
Published on 2010-05-20T20:45:04Z Indexed on 2010/05/20 20:50 UTC
Read the original article Hit count: 149

Filed under:
|

I'm trying to access the number in the below element, but I'm having trouble getting the value out of it.

echo $object->0; //returns Parse error: syntax error, unexpected T_LNUMBER, expecting T_STRING or T_VARIABLE or '{' or '$'

SimpleXMLElement Object ( 
    [0:public] => 15810
)

Any ideas on how I can get that value?

© Stack Overflow or respective owner

Related posts about php

Related posts about simplexml