php8.5
Home/ Manual/ dom / domdocument/ DOMDocument::createTextNode

DOMDocument::createTextNode

PHP function Edit on GitHub ✎

(PHP 5, PHP 7, PHP 8)

Create new text node

Description

DOMDocument::createTextNode(string $data): DOMText

This function creates a new instance of class DOMText. Inserted

Parameters

data

The content of the text.

Return Values

The new DOMText.

Changelog

VersionDescription
8.1.0In case of an error, a DomException is thrown now. Previously, false was returned.

See Also

  • DOMNode::appendChild
  • DOMDocument::createAttribute
  • DOMDocument::createAttributeNS
  • DOMDocument::createCDATASection
  • DOMDocument::createComment
  • DOMDocument::createDocumentFragment
  • DOMDocument::createElement
  • DOMDocument::createElementNS
  • DOMDocument::createEntityReference
  • DOMDocument::createProcessingInstruction

Source: reference/dom/domdocument/createtextnode.xml · from the official PHP manual (php/doc-en)