Home > php教程 > php手册 > body text

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

WBOY
Release: 2016-05-25 16:52:27
Original
1629 people have browsed it

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

改成

$room['name']  = $Name; 
$room['retailrate'] = $RetailRate;
Copy after login

               
               

文章网址:

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!