文章為你提供二款php 過濾所有HTML標(biāo)記,他可以過濾所有的html標(biāo)簽啊,去除html標(biāo)記,代碼如下:
- function text2html($txt){
- $txt = str_replace(" "," ",$txt);
- $txt = str_replace("<","<",$txt);
- $txt = str_replace(">",">",$txt);
- $txt = preg_replace("/[ ]{1,}/isu","<br/> ",$txt);
- return $txt;
- }
清除html標(biāo)記,代碼如下:
轉(zhuǎn)載請注明來源:php過濾所有HTML標(biāo)記
- function clearhtml($str){
- $str = str_replace('<','<',$str);
- $str = str_replace('>','>',$str);
- return $str;
- }//開源軟件:phpfensi.com
哈爾濱品用軟件有限公司致力于為哈爾濱的中小企業(yè)制作大氣、美觀的優(yōu)秀網(wǎng)站,并且能夠搭建符合百度排名規(guī)范的網(wǎng)站基底,使您的網(wǎng)站無需額外費用,即可穩(wěn)步提升排名至首頁。歡迎體驗最佳的哈爾濱網(wǎng)站建設(shè)。
