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

Dom\HTMLDocument::saveXmlFile

PHP function Edit on GitHub ✎

(PHP 8 >= 8.4.0)

Serializes the document as an XML file

Description

Dom\HTMLDocument::saveXmlFile(string $filename, int $options = 0): int|false

Serializes the document as an XML file.

Parameters

filename

The path to the file to save to.

options

Options

Return Values

The number of bytes written on success, or false on failure.

Errors/Exceptions

  • Throws a ValueError if filename is an empty string or contains any null bytes.

See Also

  • Dom\HTMLDocument::saveXml
  • Dom\HTMLDocument::saveHtmlFile

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