We know that there are two methods for php to write variables in the array. We will see this prompt that you have written a [name], so there will be a Notice: Use of undefined constant name-assumed name prompt, the solution is described below.
How to disable PHP prompts
Search for php. ini:
| The Code is as follows: |
Copy code |
|
Error_reporting = E_ALL |
Changed:
| The Code is as follows: |
Copy code |
|
Error_reporting = E_ALL &~ E_NOTICE |
There is another way to do this:
Add each file header
Error_reporting (0); the problem can be solved even though it is difficult to solve.
If you do not have the permission to modify php. ini, refer to my solution.
Source file:
| The Code is as follows: |
Copy code |
|
$ Room [name] = $ Name;
$ Room [retailrate] = $ RetailRate; |
Change
| The Code is as follows: |
Copy code |
|
$ Room ['name'] = $ name;
$ Room ['retailrate'] = $ retailrate; |