DOMDocument::normalizeDocument
(PHP 5, PHP 7, PHP 8)
DOMDocument::normalizeDocument — Normalizes the document
说明
This method acts as if you saved and then loaded the document, putting the document in a "normal" form.
参数
此函数没有参数。
返回值
没有返回值。
+添加备注
用户贡献的备注 1 note
lingasamy dot sakthivel at gmail dot com ¶
9 years ago
You can use this in this way.
$doc = new DOMDocument('1.0', 'UTF-8');
$doc->loadHTML($content); // html content
$xpath = new DOMXPath($doc);
$doc->normalizeDocument();
Note that, you can use $doc->normalizeDocument(); at any point of time.
备份地址:http://www.lvesu.com/blog/php/domdocument.normalizedocument.php