WordPress 函数:ent2ncr

将名称实体(named entities)的字符集转换成编号实体(numbered entities)的字符集。

用法

<?php ent2ncr( $text ) ?>

参数

$text
(string) (required) 将转换实体的文本
Default: 无

返回值

(string)
转换实体之后的文本

实例

<?php
echo ent2ncr('C&rsquo;est la f&ecirc;te!');
?>

输出:

C&#8217;est la f&#234;te!

并且看到的是:

C'est la fête!

修改记录

Since: 1.5.1

源文件

wp-includes/formatting.php.