CakeFest 2025 Madrid: The Official CakePHP Conference

Dom\CharacterData::remove

(PHP 8 >= 8.4.0)

Dom\CharacterData::removeRemoves the character data node

Description

public Dom\CharacterData::remove(): void

Removes the character data node.

Parameters

This function has no parameters.

Return Values

No value is returned.

Examples

Example #1 Dom\CharacterData::remove() example

Removes the character data.

<?php
$doc
= Dom\XMLDocument::createFromString("<container><![CDATA[hello]]><world/></container>");
$cdata = $doc->documentElement->firstChild;

$cdata->remove();

echo
$doc->saveXML();
?>

The above example will output:

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

See Also

add a note

User Contributed Notes

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

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant