开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜