php8.5
Home/ Manual/ reference / dom/ The DOMCharacterData class

The DOMCharacterData class

Represents nodes with character data. No nodes directly correspond to this class, but other nodes do inherit from it.

Intro

Represents nodes with character data. No nodes directly correspond to this class, but other nodes do inherit from it.

Class synopsis

class DOMCharacterData extends DOMNode implements DOMChildNode { }

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

VersionDescription
8.0.0The nextElementSibling and previousElementSibling properties have been added.
8.0.0DOMCharacterData implements DOMChildNode now.

See Also

  • W3C specification of CharacterData

Domcharacterdata

In this section

Source: reference/dom/domcharacterdata.xml · from the official PHP manual (php/doc-en)