PHP 清除HTML代码、空格、回车换行符的函数
PHP 清除HTML代码、空格、回车换行符的函数发布: 有时需要删除HTML代码、去掉多余的空格、删除回车换行符等等。下面就写一个函数来处理。代码如下:
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);
}
http://www.aseoe.com/show-21-529-1.html
页:
[1]