问题
I have
$number[0]
which is a object(SimpleXMLElement) type.
It has just one element.
The element has this pair 0 -- 9
9 is a string I need to have in a variable.
回答1:
If you want to access anything in your SimpleXMLElement
, you will have to access it like an object. i.e
$value = $xml->foo->bar->baz;
This is desribed in more detail at the official documentation for SimpleXML
来源:https://stackoverflow.com/questions/8230894/getting-value-from-a-simplexmlelement-object