CakeFest 2024: The Official CakePHP Conference

DOMCdataSection::__construct

(PHP 5, PHP 7, PHP 8)

DOMCdataSection::__constructDOMCdataSection nesnesi oluşturur

Açıklama

public DOMCdataSection::__construct(string $veri)

Yeni bir CDATA düğümü oluşturur. DOMText sınıfı gibi çalışır.

Bağımsız Değişkenler

veri

CDATA düğümünün değeri. Belirtilmezse CDATA düğümü boş olarak oluşturulur.

Örnekler

Örnek 1 - Yeni bir DOMCdataSection örneği oluşturmak

<?php

$dom
= new DOMDocument('1.0', 'utf-8');
$element = $dom->appendChild(new DOMElement('root'));
$text = $element->appendChild(new DOMCdataSection('root value'));
echo
$dom->saveXML();

?>

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

<?xml version="1.0" encoding="utf-8"?>
<root><![CDATA[root value]]></root>

Ayrıca Bakınız

add a note

User Contributed Notes

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