0
点赞
收藏
分享

微信扫一扫

PHP 过滤HTML代码空格,回车换行符的函数

独西楼Q 2023-03-20 阅读 54


function deletehtml($str)
{
$str = trim($str);
$str=strip_tags($str,"");
$str=preg_replace("{\t}","",$str);
$str=preg_replace("{\r\n}","",$str);
$str=preg_replace("{\r}","",$str);
$str=preg_replace("{\n}","",$str);
$str=preg_replace("{ }","",$str);
return $str;
}

举报

相关推荐

0 条评论