Get pure value from an object
Anyone know how could i get the pure value out of this kind of object:
SimpleXMLElement Object
开发者_运维百科(
[0] => 13863
)
Not matter what i did, i can not get the pure value from this object. Any advise would be helpful.
apply type casting like (int) $xml->your_node_name
details: http://php.net/manual/en/language.oop5.typehinting.php
Try this:
$value = $object->{0}
Curly braces are often useful for accessing awkwardly-named properties on objects, particularly in the context of XML.
精彩评论