Php检查非法字符函数
作者:admin 日期:2012-09-04
用于过滤某些非法字符。
PHP代码
- <?php
- function filterkeywords($keyword){
- $result=true;
- $bannedkeywords='http|www.|=|inurl|insert|select|@|site';
- $str=explode('|',$bannedkeywords);
- $count=count($str);
- for($i=0;$i<$count;$i++){
- if(strpos(strtolower($keyword),$str[$i])>0){
- $result=false;
- }
- }
- return $result;
- }
- ?>
原创代码,转载请注明出处,谢谢!
广告位