SimpleXML get node value

后端 未结 3 619
清歌不尽
清歌不尽 2020-12-11 02:11

Say I have this following XML structure:


some value<
3条回答
  •  再見小時候
    2020-12-11 03:07

    A good example of using XPath with php for the SimpleXMLElement can be found here http://www.php.net/manual/en/class.simplexmlelement.php#95229

    // Find the topmost element of the domDocument
    $xpath = new DOMXPath($xml);
    $child1 = $xpath->evaluate('/main/parent/child1')->item(0); 
    

提交回复
热议问题