Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




htmlentities2 [ WordPress Function ]

htmlentities2 ( $myHTML )
Parameters:
  • (string) $myHTML The text to be converted.
Links:
  • Borrowed from the PHP Manual user notes.
Returns:
  • (string) Converted text.
Defined at:



Convert entities, while preserving already-encoded entities.

Source


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

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics