", , $str); $str=str_replace(" ", , $str); $str=str_re">
输入banner图图片脚本导航/分类

php介绍两种过滤html标签的方法_PHP教程

php自带函数strip_tags
echo strip_tags("hello world! www.ite5e.com");

自定义函数:
function filterhtml($str) {
$str=eregi_replace("]*>", , $str);
$str=str_replace(" ", , $str);
$str=str_replace("n", , $str);
$str=str_replace("t", , $str);
$str=str_replace("::", :, $str);
$str=str_replace(" ", , $str);
//$str=str_replace(" ", , $str);
return $str;
}
$str = "www.bKjia.c0m";
调用函数 echo filterhtml($str);

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/486207.htmlTechArticlephp自带函数strip_tags echo strip_tags("hello bworld! www.ite5e.com/b"); 自定义函数: function filterhtml($str) { $str=eregi_replace("/*[^]*", , $str); $str=str_replace("...