Home  >  Article  >  php教程  >  php提示 Notice: Use of undefined constant name - assumed

php提示 Notice: Use of undefined constant name - assumed

WBOY
WBOYOriginal
2016-05-25 16:52:271680browse

我们知道php在数组中写变量有二几种方法,我们出现这种提示就是你写成了[name]这种所以会有Notice: Use of undefined constant name - assumed name提示了,解决办法参考下文。

关闭 PHP 提示的方法,搜索php.ini:

error_reporting = E_ALL 改为:error_reporting = E_ALL & ~E_NOTICE

还有个不是办法的办法就是,在每个文件头上加

error_reporting(0); 虽然不好弄但是可以解决问题,如果没有修改php.ini权限的朋友可参考我的方法来解决,源文件:

$room[name]  = $Name; 
$room[retailrate]  = $RetailRate;

改成

$room['name']  = $Name; 
$room['retailrate'] = $RetailRate;

               
               

文章网址:

随意转载^^但请附上教程地址。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn