<
>

php去除deprecated的实例方法

2022-04-15 10:56:29 来源:易采站长站 作者:

1、找到并打开“php/php.ini”文件。

2、修改内容为“error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_WARNINng = E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_WARNING

知识点扩展

php Deprecated 解决办法

这个问题是因为php版本过高。

在php5.3中,正则函数ereg_replace已经废弃,而dedecwww.easck.comms还继续用。有两个方案可以解决以上问题:

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__) ) );

//改mXATfVwUq

define('DEDEADMIN', preg_replace("/[/\\]{1,}/", '/', dirname(__FILE__) ) );

注:因为preg_replace比ereg_replace的执行速度快,PHP推荐使用preg_replace.

暂时禁止评论

微信扫一扫

易采站长站微信账号