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:
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;
|
|
Add to the header of each file
error_reporting(0); It’s not easy but it can solve the problem
If you don’t have permission to modify php.ini, you can refer to my method to 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...
|
|
|
|
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