PHP 8.1.28 Released!

DOMProcessingInstruction::__construct

(PHP 5, PHP 7, PHP 8)

DOMProcessingInstruction::__constructYeni bir DOMProcessingInstruction nesnesi oluşturur

Açıklama

public DOMProcessingInstruction::__construct(string $name, string $value = "")

Yeni bir DOMProcessingInstruction nesnesi oluşturur. Bu nesne salt okunurdur. Bir belgeye eklenebilir, fakat düğüm bir belge ile ilişkilendirilene kadar düğüme yeni düğümler eklenemez. Yazılabilir bir düğüm oluşturmak için DOMDocument::createProcessingInstruction() yöntemini kullanın.

Bağımsız Değişkenler

name

İşlem komutunun etiket ismi.

değer

İşlem komutunun değeri.

Örnekler

Örnek 1 - Yeni bir DOMProcessingInstruction oluşturmak

<?php

$dom
= new DOMDocument('1.0', 'UTF-8');
$html = $dom->appendChild(new DOMElement('html'));
$body = $html->appendChild(new DOMElement('body'));
$pinode = new DOMProcessingInstruction('php', 'echo "Merhaba Arz"; ');
$body->appendChild($pinode);
echo
$dom->saveXML();

?>

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

<?xml version="1.0" encoding="UTF-8"?>
<html><body><?php echo "Merhaba Arz"; ?></body></html>

Ayrıca Bakınız

add a note

User Contributed Notes

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