wpseek.com
WordPress开发者和主题制作者的搜索引擎



htmlentities2 › WordPress Function

Since1.2.2
已弃用n/a
› htmlentities2 ( $text )
参数:
  • (string) $text The text to be converted.
    Required: Yes
链接:
返回:
  • (string) Converted text.
定义在:
文档:

Converts entities, while preserving already-encoded entities.



源码

function htmlentities2( $text ) {
	$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( $text, $translation_table ) );
}