Dom\HTMLDocument::saveHtml
PHP function
Edit on GitHub ✎
(PHP 8 >= 8.4.0)
Serializes the document as an HTML string
Description
Dom\HTMLDocument::saveHtml(Dom\Node|null $node = null): string
Serializes the document as an HTML string.
Parameters
nodeThe node to serialize. If not provided, the entire document is serialized.
Return Values
The serialized HTML document string in the current document encoding.
Errors/Exceptions
See Also
Dom\HTMLDocument::saveHtmlFileDom\HTMLDocument::saveXml