Home  >  Article  >  Backend Development  >  php remove html tag code

php remove html tag code

WBOY
WBOYOriginal
2016-07-25 08:45:151551browse
  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


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:PHP file upload exampleNext article:PHP file upload example