Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<Dom\TextDom\TokenList>
^Dom\TextLast updated: Mon, 26 Oct 2026

Dom\Text::splitText

(PHP 8 >= 8.4.0)

Dom\Text::splitText — Breaks this node into two nodes at the specified offset

Description

public function Dom\Text::splitText(int $offset): Dom\Text

Breaks this node into two nodes at the specified offset, keeping both in the tree as siblings.

Parameters

offset

The offset at which to split, starting from 0.

Return Values

The new node of the same type, which contains all the content at and after the offset.


<Dom\TextDom\TokenList>
^Dom\TextLast updated: Mon, 26 Oct 2026