夜间模式
PHP 如何关闭 notice 级别的错误提示
方法 1
在 php.ini
文件中改动 error_reporting
改为:
bash
error_reporting=E_ALL & ~E_NOTICE
error_reporting=E_ALL & ~E_NOTICE
方法 2
如果你不能操作php.ini
文件,你可以使用如下方法
在你想禁止 notice
错误提示的页面中加入如下代码:
bash
/* Report all errors except E_NOTICE */
error_reporting(E_ALL^E_NOTICE);
/* Report all errors except E_NOTICE */
error_reporting(E_ALL^E_NOTICE);