php8.5
Home/ Manual/ dom / htmldocument/ Dom\HTMLDocument::saveXml

Dom\HTMLDocument::saveXml

PHP function Edit on GitHub ✎

(PHP 8 >= 8.4.0)

Serializes the document as an XML string

Description

Dom\HTMLDocument::saveXml(Dom\Node|null $node = null, int $options = 0): string|false

Serializes the document as an XML string.

Parameters

node

The node to serialize. If not provided, the entire document is serialized.

options

Options

Return Values

The serialized XML document string in the current document encoding, or false on failure.

Errors/Exceptions

See Also

  • Dom\HTMLDocument::saveXmlFile
  • Dom\XMLDocument::saveHtml

Source: reference/dom/dom/htmldocument/savexml.xml · from the official PHP manual (php/doc-en)