开发者

php xml get value of node

开发者 https://www.devze.com 2023-02-19 23:03 出处:网络
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>

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

精彩评论

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