ホームページ  >  記事  >  バックエンド開発  >  PHP HTMLタグ削除関数コード

PHP HTMLタグ削除関数コード

WBOY
WBOYオリジナル
2016-07-25 08:54:201162ブラウズ
  1. function noHTML($content)
  2. {
  3. $content = preg_replace("/]*>/i",'', $content);
  4. $content = preg_replace("//i", '', $content);
  5. $content = preg_replace("/
    ]*>/i",'', $content);
  6. $content = preg_replace("/
/i",'', $content);
  • $content = preg_replace("/]*>/i",'', $content);
  • $content = preg_replace("//i",'', $content);
  • $content = preg_replace("/]*>/i",'', $content);
  • $content = preg_replace("/

    /i",'', $content);
  • $content = preg_replace("/]*>/i",'', $content);
  • $content = preg_replace("//i",'', $content);
  • $content = preg_replace("/]*>/i",'' , $content);
  • $content = preg_replace("//i",'', $content);
  • $content = preg_replace("/]*> ;/i",'', $content);
  • $content = preg_replace("//i",'', $content);
  • $content = preg_replace("/]*>/i",'', $content);
  • $content = preg_replace("//i",'', $content);
  • $content = preg_replace("/ ]*>/i",'', $content);
  • $content = preg_replace("//i",'', $content);
  • $content = preg_replace("/]*>/i",'', $content);
  • $content = preg_replace("//i",'', $content);
  • $content = preg_replace("//i",'', $content);//注释内容
  • $content = preg_replace("/ ]*-->/i",'', $content);//注释内容
  • $content = preg_replace("/style=.+?['|"]/i", '',$content);//去除样式
  • $content = preg_replace("/class=.+?['|"]/i",'',$content);//去除样式
  • $content = preg_replace( "/id=.+?['|"]/i",'',$content);//去除样式
  • $content = preg_replace("/lang=.+?['|"]/i",' ',$content);//去除样式
  • $content = preg_replace("/width=.+?['|"]/i",'',$content);//去除样式
  • $content = preg_replace(" /height=.+?['|"]/i",'',$content);//去除样式
  • $content = preg_replace("/border=.+?['|"]/i",'' ,$content);//去除样式
  • $content = preg_replace("/face=.+?['|"]/i",'',$content);//去除样式
  • $content = preg_replace("/ face=.+?['|"]/",'',$content);
  • $content = preg_replace("/face=.+?['|"]/",'',$content);
  • $ content=str_replace( " ","",$content);
  • return $content;
  • }
  • 复制代

    >>> 您可能感兴趣向文章: PHP删除html标签的代码 php判断字符串否包含html标签 抽出html标签のphp代コードの例 php抽出HTML标签の方法例 php削除HTML标签の二種類の方法 php削除多余のHTML标签 php正则查找html中にidプロパティを含むhtml标签 php用strip_tags完全削除すべてのhtml标签の例分享 php删除html标签の3つの方法分享 php删除html标签及字符串中html标签の代码 php删除字符串中html标签の関数 引取html标签のphp代コード php正则过滤html标签、空格、换行符等の代価例 正常ではないHTML标签(嵌合和就近闭合をサポート)を修正 php去除html标签获得输入纯文本文档strip_tags php使用HTML标签自動补全闭合関数の代価 php实现html标签自动补全代网



    声明:
    この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。