略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: DOMDocument::normalizeDocument

2024-12-23

DOMDocument::normalizeDocument

(PHP 5, PHP 7, PHP 8)

DOMDocument::normalizeDocumentNormalizes the document

说明

public DOMDocument::normalizeDocument(): void

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

参数

此函数没有参数。

返回值

没有返回值。

参见

add a noteadd a note

User Contributed Notes 1 note

up
-3
lingasamy dot sakthivel at gmail dot com
7 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.

官方地址:https://www.php.net/manual/en/domdocument.normalizedocument.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3