filter
Besny1009
这个作者很懒,什么都没留下…
展开
-
php过滤敏感词
为了保证自己网站的纯洁性,作为服务端的一员我们有必要对用户的输入做过滤, 以下是我自己通过百度总结的自己的过滤的方法 key.txt是要过滤的敏感词的txt文件public function FilterWorde($str){ $content = file_get_contents("../public/word/key.txt"); $arr = explode原创 2017-04-17 17:51:21 · 398 阅读 · 0 评论 -
PHP过滤敏感词
主要使用了 int substr_count ( string haystack, string needle [, int offset [, int length]] ) 这个方法,这个方法遍历待测的字符串str中有没有str中有没有allergicWord数组中所包含的敏感词: [php] view plain copy$allergicWord = array('脏话','骂人话')转载 2017-04-14 10:53:33 · 532 阅读 · 0 评论