php提示Notice: Undefined variable

  解决方法如下:

   一、修改php.ini配置文件

            error_reporting设置:
            找到error_reporting = E_ALL
            修改为error_reporting = E_ALL & ~E_NOTICE

             原理是:减弱PHP的敏感程度,使其遇到这种问题不报错。

    二、在文件的php的头部加入一下代码:

            ini_set("error_reporting","E_ALL & ~E_NOTICE");

           同样也可以解决问题。

猜你喜欢

转载自blog.csdn.net/qq_36769704/article/details/76185201