htmlentities2( string $myHTML )

Convert entities, while preserving already-encoded entities.


Description Description


Parameters Parameters

$myHTML

(string) (Required) The text to be converted.


Top ↑

Return Return

(string) Converted text.


Top ↑

Source Source

File: wp-includes/formatting.php

function htmlentities2( $myHTML ) {
	$translation_table              = get_html_translation_table( HTML_ENTITIES, ENT_QUOTES );
	$translation_table[ chr( 38 ) ] = '&';
	return preg_replace( '/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/', '&', strtr( $myHTML, $translation_table ) );
}

Top ↑

Changelog Changelog

Changelog
Version Description
1.2.2 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.