function trimHtml($str, $allow = '')
{
$str = str_replace(PHP_EOL, '', $str);
$str = str_replace('<br />' , "\n", $str);
$str = strip_tags($str, $allow);
$str = str_replace(' ' , '', $str);
$str = str_replace(' ' , ' ', $str);
$str = str_replace(array("\r\n", "\r", "\n"), "", $str);//去除回车换行符
return $str;
}
去除文本中的html标签
最新推荐文章于 2023-04-18 00:20:46 发布