php敏感词处理
2015-10-12 14:57
489 查看
<span style="white-space:pre"> </span>//敏感词处理 public function badwords($content,$flag = 0){ $badwords_dir = array( 'badword.php', 'adverlow.php' ); $info = ''; require('Conf/'.$badwords_dir[$flag]); for ($i=0;$i<count($badword);$i++){ $time = substr_count($content, $badword[$i]); if($time>0){ $info = $badword[$i]; break; } } return $info; } public function replaceBD($trans_str = ''){ require('Conf/badword.php'); $badwordarr = array_combine($badword,array_fill(0,count($badword),'***')); return strtr($trans_str, $badwordarr); }
相关文章推荐
- PHP刷新输出缓冲
- PHP JSON_ENCODE 不转义中文汉字的方法
- yii命令行下运行控制器【没有验证】
- PHP之CURL模块上传文件
- 如何下载PHP开发文档
- PHP获取MP3时长类
- PHP递归实现无限极分类
- PHP文件缓存类
- 编程图记(2): 学用PHP框架Lavarel
- php中,if后直接接变量,是什么意思
- PHP 之 FastCGI 与 mod_php
- ThinkPHP框架概述
- 98 php 访问本地项目localhost很慢
- PHP的魔术方法
- Copying an image from one server to another using PHP
- php的rss订阅
- PHPthinking官方论坛
- thinkphp-关于获取当前时间的问题,模板引擎为smarty
- editPlus,3.7V 注册码
- PHPStorm下XDebug配置