Dutch PHP Conference 2025 - Call For Papers

DOMElement::remove

(PHP 8)

DOMElement::removeRemoves the element

Опис

public DOMElement::remove(): void

Removes the element.

Параметри

У цієї функції немає параметрів.

Значення, що повертаються

Не повертає значень.

Приклади

Приклад #1 DOMElement::remove() example

Removes the element.

<?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