代码如下 | 复制代码 |
*/ public function deletecomment($id) { $xml = new domdocument(); $xml->validateonparse=true; $xml->loadxml($this->getcontents(true)); $message = $xml->getelementbyid($id); $parentnode = $message->parentnode; $parentnode->removechild($message); $this->putcontents($xml->savexml()); } /* xml 文档 ]> |
*/