function filter($string) {
$search = array ("'<script[?>]*?>.*?</script>'si", // Remove javascript.
"'<[\/\!]*?[^<?>]*?>'si", // Remove HTML tags.
"'<>'si", // Remove HTML tags.
"'([\r\n])[\s]+'", // Remove spaces.
"'&(quot|#34);'i", // Remove HTML entites.
"'&(amp|#38);'i",
"'&(lt|#60);'i",
"'&(gt|#62);'i",
"'&(nbsp|#160);'i",
"'&(iexcl|#161);'i",
"'&(cent|#162);'i",
"'&(pound|#163);'i",
"'&(copy|#169);'i",
"'&#(\d+);'e"); // Evaluate like PHP.
$replace = array ("",
"",
"\\1",
"\"",
"&",
"<",
"?>",
" ",
chr(161),
chr(162),
chr(163),
chr(169),
"chr(\\1)");
return mysql_real_escape_string(preg_replace ($search, $replace, $string));
}
I bought some script on internet, and developer is not responding, i fixed everything because a lot of things was deprecated, but i can't fix this. This is error
PHP Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /home/bioskop/public_html/gold-app/gold-includes/GOLD.php on line 72
I tried php version 5.4, 5.5, 5.6 and 7.0. NO success. Please help me upgrade this i'm really new in php. This code is SOLD and it must worked at some point.