DOMComment->__construct()とは? わかりやすく解説

Weblio 辞書 > コンピュータ > PHP関数リファレンス > DOMComment->__construct()の意味・解説 

DOMComment->__construct()

(PHP 5)
DOMComment->__construct() — 新しい DOMComment オブジェクトを作成する

説明

class DOMComment {
__construct ( [string value] )
} 新しい DOMComment オブジェクトを作成します。 このオブジェクトは読み込み専用です。このオブジェクトをドキュメントに 追加することが可能ですが、ノードがドキュメントと関連付けられるまでは ノードを追加することはできません。書き込み可能なノードを作成するには、 DOMDocument->createComment() を使用します。

パラメータ

value
コメントの値。

例 485. 新しい DOMComment を作成する
<?php

$dom = new DOMDocument('1.0', 'iso-8859-1');
$element = $dom->appendChild(new DOMElement('root'));
$comment = $element->appendChild(new DOMComment('root comment'));
echo $dom->saveXML(); /* <?xml version="1.0" encoding="iso-8859-1"?><root><!--root comment--></root> */

?>


参考

DOMDocument->createComment()




英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「DOMComment->__construct()」の関連用語

DOMComment->__construct()のお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DOMComment->__construct()のページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
PHP Documentation GroupPHP Documentation Group
Copyright © 1997 - 2025 by the PHP Documentation Group.

©2025 GRAS Group, Inc.RSS