略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: Dom\HTMLDocument::saveXmlFile

2025-02-27

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.

错误/异常

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

参见

添加备注

用户贡献的备注

此页面尚无用户贡献的备注。

官方地址:https://www.php.net/manual/en/dom-htmldocument.savexmlfile.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3