function getSimpleText($str = '')
{
if (!empty($str)) {
$content_02 = htmlspecialchars_decode($str);//把一些预定义的 HTML 实体转换为字符
$content_03 = str_replace(" ", "", $content_02);//将空格替换成空
$contents = strip_tags($content_03);//函数剥去字符串中的 HTML、XML 以及 PHP 的标签,获取纯文本内容
} else {
$contents = '';
}
return $contents;
}
从富文本获取纯文本
最新推荐文章于 2024-06-03 10:09:20 发布