phpday 2027 - Call for Papers

DOMElement::remove

(PHP 8)

DOMElement::remove — Elimina el elemento

Descripción

public function DOMElement::remove(): void

Elimina el elemento.

Parámetros

Esta función no contiene ningún parámetro.

Valores devueltos

No se retorna ningún valor.

Ejemplos

Ejemplo #1 Ejemplo de DOMElement::remove()

Elimina el elemento.

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

$hello->remove();

echo $doc->saveXML();
?>

El ejemplo anterior mostrará:

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

Véase también

User Contributed Notes

There are no user contributed notes for this page.
Adding new notes is disabled. Please see the links in the Found A Problem? section.
To Top