jy166102 发表于 2015-8-22 14:59:20

Notice: Use of undefined constant out

Notice: Use of undefined constant out - assumed 'out' in D:wampwwwdaoruindex.php on line 4解决办法
  Notice: Use of undefined constant out - assumed 'out' in D:\wamp\www\daoru\index.php on line 4解决办法

  在开发中会出现如下提示:

  

  这些是 PHP 的提示而非报错,PHP 本身不需要事先声明变量即可直接使用,但是对未声明变量会有提示。一般作为正式的网站会把提示关掉的,甚至连错误信息也被关掉

  解决办法:
  1.在开头加上error_reporting(E_ALL & ~E_NOTICE);
  这句话表示提示除去 E_NOTICE 之外的所有错误信息 因为post数组是个空的array,而代码中的这种方法适用于的是提交以后
  

  2.如果觉得上述办法不彻底,还可以关闭php提示功能:
  
  搜索php.ini:
  error_reporting = E_ALL
  改为:
  error_reporting = E_ALL & ~E_NOTICE
  
  文章来源链接:http://blog.iyunv.com/yueguanghaidao/article/details/6854417
  
页: [1]
查看完整版本: Notice: Use of undefined constant out