DOMDocument::createComment
PHP function
Edit on GitHub ✎
(PHP 5, PHP 7, PHP 8)
Create new comment node
Description
DOMDocument::createComment(string $data): DOMComment
This function creates a new instance of class DOMComment. Inserted
Parameters
dataThe content of the comment.
Return Values
The new DOMComment.
Changelog
| Version | Description |
|---|---|
| 8.1.0 | In case of an error, a DomException is thrown now. Previously, false was returned. |
See Also
DOMNode::appendChildDOMDocument::createAttributeDOMDocument::createAttributeNSDOMDocument::createCDATASectionDOMDocument::createDocumentFragmentDOMDocument::createElementDOMDocument::createElementNSDOMDocument::createEntityReferenceDOMDocument::createProcessingInstructionDOMDocument::createTextNode