I suddenly encountered the php Notice: Use of undefined constant error when I was doing php. One is that the variable is undefined. Let's take a look at the solution.
Error Message
Php Notice: Use of undefined constant
Analysis
These are PHP prompts rather than errors. PHP itself can be directly used without declaring variables in advance, but there will be prompts for un-declared variables. Generally, when a website is a formal website, it will turn off the prompt and even the error message.
Solution
How to disable PHP prompts
Search for php. ini:
The Code is as follows: |
Copy code |
Error_reporting = E_ALL Changed: Error_reporting = E_ALL &~ E_NOTICE |
There is another way to do this:
Add each file header
The Code is as follows: |
Copy code |
Error_reporting (0); the problem can be solved even though it is difficult to solve. |
Foreign reference articles
Hello,
You need to change your php. ini file
Find the word "error_reporting" in your php. ini file and make
Change like below ..
The Code is as follows: |
Copy code |
Error_reporting = E_ALL &~ E_NOTICE &~ E_STRICT |
Regards
R. Sureshkannan