php prompt Notice: Use of undefined constant name - assumed_PHP tutorial

WBOY
Release: 2016-07-13 10:56:55
Original
1084 people have browsed it

We know that there are two ways to write variables in PHP arrays. When we get this prompt, you write [name], so there will be a Notice: Use of undefined constant name - assumed name. Please refer to the solution. below.

How to turn off PHP prompts

Search php.ini:

The code is as follows
 代码如下 复制代码

  error_reporting = E_ALL

Copy code

 代码如下 复制代码

  error_reporting = E_ALL & ~E_NOTICE

error_reporting = E_ALL

changed to:

Add
The code is as follows

Copy code

 error_reporting = E_ALL & ~E_NOTICE

 代码如下 复制代码

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

Another alternative is
 代码如下 复制代码

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

to the header of each file

error_reporting(0); It’s not easy but it can solve the problem

Source file:
The code is as follows Copy code
$room[name] = $Name;
$room[retailrate] = $RetailRate; changed to
The code is as follows Copy code
$room['name'] = $Name;
$room['retailrate'] = $RetailRate; http://www.bkjia.com/PHPjc/632127.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632127.htmlTechArticleWe know that there are two ways to write variables in PHP arrays. When we get this prompt, you write [ name], so there will be a Notice: Use of undefined constant name - assumed name...
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template