我刚刚为更新后的用户bios创建了一个简单的单词过滤器。这是代码:
for($i=0;$i < sizeof($badwords);$i++){
srand((double)microtime()*1000000);
$rand_key = (rand()%sizeof($replacements));
$str = eregi_replace($badwords[$i], $replacements[$rand_key], $str);
}
return $str;
}
当我提交的生物,文本保存,但我得到这个错误:
Deprecated:函数eregi_replace()在/home/u557520691/public_html/inc/Global.php第177行
有人知道如何解决这个问题吗?
try this
如何替换ereg?
或者直接关闭通知
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
或
error_reporting(E_ALL ^ E_DEPRECATED);