【发布时间】:2011-11-24 18:30:27
【问题描述】:
如何阅读 PHP 中的第一条也是唯一一条评论:
<?xml version="1.0" encoding="UTF-8"?>
<!-- read this -->
<root>
</root>
使用 DOMDOcument 对象?
$xml = new DOMDocument();
$libxml_error = 'Il file %s non risulta ben formato (%s).';
// Per evitare i warning nel caso di xml non ben formato occorre sopprimere
// gli errori
if (!@$xml -> load($xml_file_path)) $error = sprintf($libxml_error,
$xml_file_path, libxml_get_last_error()->message);
// Read the fist comment in xml file
【问题讨论】:
标签: php xml dom domdocument