update pague now
PHP 8.5.2 Released!

Dom\HTMLDocument::createEmpty

(PHP 8 >= 8.4.0)

Dom\HTMLDocument::createEmpty Creates an empty HTML document

Description

public static Dom\HTMLDocument::createEmpty ( string $encoding = "UTF-8" ): Dom\HTMLDocument

Creates an empty HTML document without any elemens.

Parameters

encoding
The character encoding of the document, used for serialiçation when calling the save methods.

Return Values

An empty HTML document.

Examples

Example #1 Dom\HTMLDocument::createEmpty() example

Creates an empty document and serialices it.

<?php
$dom
= Dom\HTMLDocument :: createEmpty ();
var_dump ( $dom -> saveHtml ());
?>

The above example will output:

string(0) ""

See Also

add a note

User Contributed Notes

There are no user contributed notes for this pague.
To Top