PHP头条
热点:

php错误提示:Deprecated: Function eregi() is deprecated


今天在利用一个正则时提示Deprecated: Function eregi() is deprecated in错误了,后来查询了一原因是我们php5.3,在5.3中己经不支持eregi函数了,可以直接使用preg_match来代替。

改前:function inject_check($sql_str) {

 代码如下 复制代码
 $sql_str = strtolower($sql_str);
 return eregi('fopen|post|eval|select|insert|and|or|update|delete|'|/*|*|../|./|union|into|load_file|outfile', $sql_str); // 进行过滤
}

解决方法:

找到代码所在的文件 位置

 代码如下 复制代码


function inject_check($sql_str) {
 $sql_str = strtolower($sql_str);
 return preg_match('/fopen|post|eval|select|insert|and|or|update|delete|'|/*|*|../|./|union|into|load_file|outfile/', $sql_str); // 进行过滤
}

注意:一定要加'/'开头与结束哦。

www.phpzy.comtrue/php/26248.htmlTechArticlephp错误提示:Deprecated: Function eregi() is deprecated 今天在利用一个正则时提示Deprecated: Function eregi() is deprecated in错误了,后来查询了一原因是我们php5.3,在5.3中己经不支持eregi函数了,可以直...

相关文章

    暂无相关文章

PHP之友评论

今天推荐