文章為你提供二款php 過濾所有HTML標(biāo)記,他可以過濾所有的html標(biāo)簽啊,去除html標(biāo)記,代碼如下:

  1. function text2html($txt){ 
  2.         $txt = str_replace("  "," ",$txt); 
  3.         $txt = str_replace("<","&lt;",$txt); 
  4.         $txt = str_replace(">","&gt;",$txt); 
  5.         $txt = preg_replace("/[ ]{1,}/isu","<br/> ",$txt); 
  6.         return $txt

清除html標(biāo)記,代碼如下:

  1. function clearhtml($str){ 
  2.         $str = str_replace('<','&lt;',$str); 
  3.         $str = str_replace('>','&gt;',$str); 
  4.         return $str; 
  5. }//開源軟件:phpfensi.com
轉(zhuǎn)載請注明來源:php過濾所有HTML標(biāo)記

  哈爾濱品用軟件有限公司致力于為哈爾濱的中小企業(yè)制作大氣、美觀的優(yōu)秀網(wǎng)站,并且能夠搭建符合百度排名規(guī)范的網(wǎng)站基底,使您的網(wǎng)站無需額外費用,即可穩(wěn)步提升排名至首頁。歡迎體驗最佳的哈爾濱網(wǎng)站建設(shè)。