2011-02-25 127 views
-1

可能重复:
Why is ereg deprecated in PHP?弃用运行时错误

我将文件上传到服务器,但我得到了以下错误

Deprecated: Function ereg_replace() is deprecated in /home/vicedu/public_html/includes 
/functions/sessions.php on line 112 

我能做些什么?请帮助

+0

已过时的功能是一个这是应该避免和语言库的存在,你的情况,你应该使用的preg_replace()而不是ereg_replace(),你可以在这里看到的文档更好的替代品,功能:HTTP:/ /php.net/manual/en/function.preg-replace.php – 2011-02-25 07:40:23

+0

请指出为什么http://stackoverflow.com/search?q=ereg+deprecated中没有答案帮助解决您的问题。 – Gordon 2011-02-25 08:13:53

+0

的[为什么'在PHP ereg'过时?](http://stackoverflow.com/questions/3078993/why-is-ereg-deprecated-in-php) – Gordon 2011-02-25 08:14:08

回答

1

您可以切换到preg_replace,因为eregi已被弃用,并更新您的模式由于preg_*变体是PCRE语法。

3

函数ereg_replace()已过时是否意味着取代,应该避免形式的PHP中ereg_replace()可以使用的preg_replace的更换。这将明确解决您的问题。

+2

它已不被删除重复的明确还... 。只是强烈反对。 – 2011-02-25 06:46:28