PHP怎么清除HTML代码、空格、回车换行符的函数(html,php,开发技术)

时间:2024-05-05 07:09:06 作者 : 石家庄SEO 分类 : 开发技术
  • TAG :

    PHP%E6%80%8E%E4%B9%88%E6%B8%85%E9%99%A4HTML%E4%BB%A3%E7%A0%81%E3%80%81%E7%A9%BA%E6%A0%BC%E3%80%81%E5%9B%9E%E8%BD%A6%E6%8D%A2%E8%A1%8C%E7%AC%A6%E7%9A%84%E5%87%BD%E6%95%B0

代码如下:


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


可以根据需要对这个函数进行扩充修改。

本文:PHP怎么清除HTML代码、空格、回车换行符的函数的详细内容,希望对您有所帮助,信息来源于网络。
上一篇:什么是驱动器下一篇:

5 人围观 / 0 条评论 ↓快速评论↓

(必须)

(必须,保密)

阿狸1 阿狸2 阿狸3 阿狸4 阿狸5 阿狸6 阿狸7 阿狸8 阿狸9 阿狸10 阿狸11 阿狸12 阿狸13 阿狸14 阿狸15 阿狸16 阿狸17 阿狸18