htmlentities2()
最后更新于:2021-11-27 05:43:41
htmlentities2( string$myHTML)Convert entities, while preserving already-encoded entities.
参数
- $myHTML
-
(string) (Required) The text to be converted.
响应
(string) Converted text.
源文件
文件: gc-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 ) );
}