wp_html_split() WordPress Function

The wp_html_split() function is used to split HTML content into manageable chunks. This function is useful for those who want to process large amounts of HTML data, such as when parsing HTML documents or when working with the output of the wp_kses() function.

wp_html_split( string $input ) #

Separates HTML elements and comments from the text.


Parameters

$input

(string)(Required)The text which has to be formatted.


Top ↑

Return

(string[]) Array of the formatted text.


Top ↑

Source

File: wp-includes/formatting.php

function wp_html_split( $input ) {
	return preg_split( get_html_split_regex(), $input, -1, PREG_SPLIT_DELIM_CAPTURE );
}


Top ↑

Changelog

Changelog
VersionDescription
4.2.4Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More