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

php去除html标签代码

时间:2014-06-27 02:10来源:网络整理 作者:网络 点击:
分享到:
php去除html标签代码 如下代码实现去除HTML标记 :```phplt;? function Text2Html($txt){ $txt = str_replace(quot; quot;,quot; quot;,$txt); $txt = str_replace(quot;lt;quot;,quot;amp;lt;quot;,$txt); $txt = str_replac

如下代码实现去除HTML标记 :

<? 
function Text2Html($txt){ 
        $txt = str_replace("  "," ",$txt); 
        $txt = str_replace("<","&lt;",$txt); 
        $txt = str_replace(">","&gt;",$txt); 
        $txt = preg_replace("/[rn]{1,}/isU"," 
rn",$txt); 
        return $txt; 
} 

?> 
精彩图集

赞助商链接