xml 结构如下<?xml version="1.0" encoding="utf-8"?>
<note>
</note>php如下
$note = simplexml_load_file("a.xml");
$note->appendChild(new DOMElement("time","aaa"));
<note>
</note>php如下
$note = simplexml_load_file("a.xml");
$note->appendChild(new DOMElement("time","aaa"));
$note = simplexml_load_file("a.xml");
$note->addChild("time","aaa");
file_put_contents('a.xml', $note->asXML());