html变text文本
作者:互联网
html变text文本
public function htmltext($content){
$content = preg_replace("/<img\s*src=(\"|\')(.*?)\\1[^>]*>/is",'【图片】', $content);
$content = strip_tags($content);
$content = trim($content);
$content = ereg_replace("\t","",$content);
$content = ereg_replace("\r\n","",$content);
$content = ereg_replace("\r","",$content);
$content = ereg_replace("\n","",$content);
$content = ereg_replace(" ","",$content);
return $content;
}
标签:text,replace,content,html,ereg,文本 来源: https://blog.csdn.net/qq_42239585/article/details/115318352