Uma área de pesquisa sobre o WordPress para devs e autores do tema



htmlentities2 ›

Desde1.2.2
Obsoleton/a
htmlentities2 ( $myHTML )
Parâmetros:
  • (string) $myHTML The text to be converted.
    Required: Yes
Links:
  • Borrowed from the PHP Manual user notes.
Retorna:
  • (string) Converted text.
Definido em:
Codex:

Convert entities, while preserving already-encoded entities.



Fonte

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) );
}