Dom\HTMLDocument::saveHtml

Serializes the document as an HTML string

Description

public string Dom\HTMLDocument::saveHtml(Dom\Nodenull $node = null)

Serializes the document as an HTML string.

Parameters

node
The 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

  • Throws a Dom\DOMException with code Dom\WRONG_DOCUMENT_ERR if node is from another document.

See Also

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