龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > php编程 >

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

时间:2014-07-22 14:51来源: 作者: 点击:
分享到:
PHP 过滤HTML代码空格,回车换行符的函数
PHP 过滤HTML代码空格,回车换行符的函数
/**
 * PHP 过滤HTML代码空格,回车换行符的函数
 * echo deletehtml()
 */
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;
}
精彩图集

赞助商链接