php simplexml get object variable start with number
When I parse an rss file with SimpleXMLElement, I get this object :
object(SimpleXMLElemen开发者_如何学编程t)#307 (1) {
[0]=>
string(39) "http://workspace/wordpress/hello-world/"
}
$var->0 doesn't works.
I don't know how to do it :(
thanks.
It behaves like an array
echo $var[0];
In this case - when there's only one (child) element - you don't even have to use the index
echo $var;
精彩评论