DOMDocument::createTextNode

(PHP 5, PHP 7, PHP 8)

DOMDocument::createTextNodeCreate new text node

說明

public DOMDocument::createTextNode(string $data): DOMText

This function creates a new instance of class DOMText. 此節(jié)點(diǎn)出現(xiàn)在文檔中,除非是用諸如 DOMNode->appendChild() 等函數(shù)來將其插入。

參數(shù)

data

The content of the text.

返回值

The new DOMText.

更新日志

版本 說明
8.1.0 In case of an error, a DomException is thrown now. Previously, false was returned.

參見