您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

php过滤所有HTML标记

2025/12/30 1:56:46发布16次查看
文章为你提供二款php 过滤所有html标记,他可以过滤所有的html标签啊,去除html标记,代码如下:
function text2html($txt){ 
        $txt = str_replace(  , ,$txt); 
        $txt = str_replace(<","&lt;",$txt);
$txt = str_replace(">,>,$txt); 
        $txt = preg_replace(/[ ]{1,}/isu,<br/> ,$txt); 
        return $txt; 

清除html标记,代码如下:
function clearhtml($str){ 
        $str = str_replace('<','&lt;',$str);
$str = str_replace('>','>',$str); 
        return $str; 
}//开源软件:phpfensi.com
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product