Statement on glibc/iconv Vulnerability

DOMElement::remove

(PHP 8)

DOMElement::remove要素を削除する

説明

public DOMElement::remove(): void

要素を削除します。

パラメータ

この関数にはパラメータはありません。

戻り値

値を返しません。

例1 DOMElement::remove() の例

要素を削除します。

<?php
$doc
= new DOMDocument;
$doc->loadXML("<container><hello/><world/></container>");
$hello = $doc->documentElement->firstChild;

$hello->remove();

echo
$doc->saveXML();
?>

上の例の出力は以下となります。

<?xml version="1.0"?>
<container><world/></container>

参考

add a note

User Contributed Notes

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