php教程

DOMDocument::normalizeDocument

(PHP 5, PHP 7)

DOMDocument::normalizeDocumentNormalizes the document

说明

public DOMDocument::normalizeDocument ( void ) : void

This method acts as if you saved and then loaded the document, putting the document in a "normal" form.

返回值

没有返回值。

参见

User Contributed Notes

lingasamy dot sakthivel at gmail dot com 16-Apr-2015 05:44
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.

CopyRight © 2008-2022 verySource.Com All Rights reserved. 京ICP备17048824号-1 京公网安备:11010502034788