CakeFest 2024: The Official CakePHP Conference

DOMComment::__construct

(PHP 5, PHP 7, PHP 8)

DOMComment::__constructYeni bir DOMComment nesnesi oluşturur

Açıklama

public DOMComment::__construct(string $data = "")

Yeni bir DOMComment nesnesi oluşturur. Nesne bu haliyle bir belgeye eklenebilir, fakat belge ile ilişkilendirilinceye kadar yeni bir düğüm eklenemez. Yazılabilir bir düğüm oluşturmak için DOMDocument::createComment() yöntemini kullanın.

Bağımsız Değişkenler

data

Açıklama değeri.

Örnekler

Örnek 1 - Yeni bir DOMComment oluşturmak

<?php

$dom
= new DOMDocument('1.0', 'utf-8');
$element = $dom->appendChild(new DOMElement('root'));
$comment = $element->appendChild(new DOMComment('bir açıklama'));
echo
$dom->saveXML();

?>

Yukarıdaki örneğin çıktısı:

<?xml version="1.0" encoding="iso-8859-1"?>
<root><!-- bir açıklama --></root>

Ayrıca Bakınız

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top