Deprecated: Function ereg_replace() is deprecated的解决方法
白春媛吧
全部回复
仅看楼主
level 8
白春媛 楼主
泡在网上的日子 发表于2012-04-28 14:03, 第 2655 次阅读
摘要 这个问题是因为你用的php版本过高。 在php5.3中,正则函数ereg_replace已经废弃,而dedecms还继续用。有两个方案可以解决以上问题: 1、把php版本换到v5.3下。 2、继续使用v5.3,修改php.ini文件 ;extension=php_mbstring.dll 改为 extension=php_mbstring.d 这个问题是因为你用的php版本过高。在php5.3中,正则函数ereg_replace已经废弃,而dedecms还继续用。有两个方案可以解决以上问题:1、把php版本换到v5.3下。2、继续使用v5.3,修改php.ini文件;extension=php_mbstring.dll改为extension=php_mbstring.dll;mbstring.func_overload = 0修改为:mbstring.func_overload = 7或者使用其他的函数:define('DEDEADMIN', ereg_replace("[/\\]{1,}", '/', dirname(__FILE__) ) );
//改为
define('DEDEADMIN', preg_replace("/[\/\\\\]{1,}/", '/', dirname(__FILE__) ) );注:因为preg_replace比ereg_replace的执行速度快,PHP推荐使用preg_replace.
2013年06月06日 05点06分 1
1