- 注册时间
- 2007-7-24
- 最后登录
- 2012-4-17
- 在线时间
- 254 小时
- 阅读权限
- 100
- 积分
- 1701
- 帖子
- 283
- 精华
- 0
- UID
- 3
  

|
- /**
- * 返回是否含有敏感词
- */
- function checkWords($text, $filterWords) {
- $text = trim($text);
- $filterWords = preg_replace('/([\[\(\)\]])/' , '\\\${1}' , $filterWords);
- $result = preg_match("/(?:".$filterWords.")/" , $text , $matches);
- return empty($matches)?false:$matches;
- }
- /**
- * 返回包含的所有敏感词
- */
- function checkWordsM($text, $filterWords) {
- $text = trim($text);
- $filterWords = preg_replace('/([\[\(\)\]])/' , '\\\${1}' , $filterWords);
- $result = preg_match_all("/(?:".$filterWords.")/" , $text , $matches);
- return empty($matches)?false:$matches;
- }
复制代码 |
|