开发者

php xml get value of node

How can I get "bla" in the below dump of my node Essentially bla is what is contained in my node

<mynode name="myvalueone" display="myvalue2">bla</mynode>


object(SimpleXMLElement)[21]
  publi开发者_Python百科c '@attributes' => 
    array
      'name' => string 'myvalueone' (length=65)
      'display' => string 'myvalue2' (length=9)
  string 'bla' (length=3)


You can obtain the value by casting the SimpleXMLElement to a string like this: $value = (string)$element;

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜