首頁 >後端開發 >php教程 >php去除html標籤代碼

php去除html標籤代碼

WBOY
WBOY原創
2016-07-25 08:45:151699瀏覽
  1. function Text2Html($txt){
  2. $txt = str_replace(" "," ",$txt);
  3. $txt = str_replace("<","<",$txt);
  4. $txt = str_replace(">",">",$txt);
  5. $txt = preg_replace("/[rn]{1,}/isU","
  6. rn",$txt);
  7. return $txt;
  8. }
  9. ?>
复制代码

php, html


陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn