PHP头条
热点:

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


我们知道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;

www.phpzy.comtrue/php/26374.htmlTechArticlephp提示 Notice: Use of undefined constant name - assumed 我们知道php在数组中写变量有二几种方法,我们出现这种提示就是你写成了[name]这种所以会有Notice: Use of undefined constant name - assumed name提示了...

相关文章

    暂无相关文章

PHP之友评论

今天推荐