xml的读取

查找body节点的子节点

<?php
$note=<<<XML
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body><span>Important!</span> Don't forget me this weekend!</body>
</note>
XML;

$xml=simplexml_load_string($note);
foreach ($xml->body[0]->children() as $child)
{
echo "Child node: " . $child . "<br>";
}

原文地址:https://www.cnblogs.com/llzhang123/p/8241088.html