array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'dom-htmldocument.savexmlfile.php', 1 => 'Dom\\HTMLDocument::saveXmlFile', 2 => 'Serializes the document as an XML file', ), 'up' => array ( 0 => 'class.dom-htmldocument.php', 1 => 'Dom\\HTMLDocument', ), 'prev' => array ( 0 => 'dom-htmldocument.savexml.php', 1 => 'Dom\\HTMLDocument::saveXml', ), 'next' => array ( 0 => 'class.dom-htmlelement.php', 1 => 'Dom\\HTMLElement', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/dom/dom/htmldocument/savexmlfile.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

Dom\HTMLDocument::saveXmlFile

(PHP 8 >= 8.4.0)

Dom\HTMLDocument::saveXmlFileSerializes the document as an XML file

说明

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

Serializes the document as an XML file.

参数

filename
The path to the file to save to.
options
Additional Options. The LIBXML_NOEMPTYTAG and LIBXML_NOXMLDECL options are supported. Prior to PHP 8.3.0, only the LIBXML_NOEMPTYTAG option is supported.

返回值

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

错误/异常

参见