PHP 8.4.3 Released!

Dom\HTMLDocument::createEmpty

(PHP 8 >= 8.4.0)

Dom\HTMLDocument::createEmptyCreates an empty HTML document

Beschreibung

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

Creates an empty HTML document without any elements.

Parameter-Liste

encoding
The character encoding of the document, used for serialization when calling the save methods.

Rückgabewerte

An empty HTML document.

Beispiele

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

Creates an empty document and serializes it.

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

Das oben gezeigte Beispiel erzeugt folgende Ausgabe:

string(0) ""

Siehe auch

add a note

User Contributed Notes

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