The DOMCharacterData class
(PHP 5, PHP 7, PHP 8)
Introduction
Represents nodes with character data. No nodes directly correspond to this class, but other nodes do inherit from it.
Class synopsis
bool
$exclusive
= false
,bool
$withComments
= false
,?array
$xpath
= null
,?array
$nsPrefixes
= null
): string|false
string
$uri
,bool
$exclusive
= false
,bool
$withComments
= false
,?array
$xpath
= null
,?array
$nsPrefixes
= null
): int|false
Properties
- data
-
The contents of the node.
- length
-
The length of the contents.
- nextElementSibling
-
The next sibling element or
null
. - previousElementSibling
-
The previous sibling element or
null
.
Changelog
Version | Description |
---|---|
8.0.0 | The nextElementSibling and previousElementSibling properties have been added. |
8.0.0 | DOMCharacterData implements DOMChildNode now. |
Table of Contents
- DOMCharacterData::appendData — Append the string to the end of the character data of the node
- DOMCharacterData::deleteData — Remove a range of characters from the node
- DOMCharacterData::insertData — Insert a string at the specified 16-bit unit offset
- DOMCharacterData::replaceData — Replace a substring within the DOMCharacterData node
- DOMCharacterData::substringData — Extracts a range of data from the node