afridy
1
Hello,
ereg is diprecated. so please help me to replace ereg in below code.
$answer=true;
$arr = array
("select","union","order","by","update","drop","use","group","by","insert","load_file","into","in","to","outfile","having","substr","hex","unhex","where","--","/","\\'","\\"");
for($i=0;$i<sizeof($arr);$i++)
{
if(ereg($arr[$i],strtolower($str))){
$answer=false;
}
}
Give this a whirl
$answer = true;
$arr = array("select","union","order","by","update","drop","use","group","by","insert","load_file","into","in","to","outfile","having","substr","hex","unhex","where","--","\\/","\\'","\\"");
for($i = 0; $i < sizeof($arr); $i++) {
if (preg_match('/' . $arr[$i] . '/', strtolower($str))) {
$answer = false;
}
}
afridy
3
thanks buddy,
works charm!