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
nodeThe node to serialize. If not provided, the entire document is serialized.
optionsOptions
Return Values
The serialized XML document string in the current document encoding, or false on failure.
Errors/Exceptions
See Also
Dom\HTMLDocument::saveXmlFileDom\XMLDocument::saveHtml