DOMDocument::createComment

(PHP 5, PHP 7, PHP 8)

DOMDocument::createCommentCreate new comment node

說明

public DOMDocument::createComment(string $data): DOMComment

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

參數(shù)

data

The content of the comment.

返回值

The new DOMComment.

更新日志

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

參見