In Windows: Sometimes a program running normally in other environments reports an error in its own environment. The program reports an Undefinedindex: for example, the following code is available: Undefinedvarialbe: here is a solution found on the Internet: The problem is as follows: 1. where is the problem? 2. How should I modify this code? 3. Do not change the code segment
In Windows: Sometimes a program running normally in other environments reports an error in its own environment. The program reports an Undefined index. For example, the following code is available: Undefined varialbe: here is a solution found on the Internet: The problem is as follows: 1. where is the problem? 2. How should I modify this code? 3. Do not change the code segment
In Windows: Sometimes a program running normally in other environments reports an error in its own environment. The program reports an Undefined index:
For example, the following code is available:
Undefined varialbe:
Here is a solution found on the Internet:
The problem is as follows:
1. Where is the problem?
2. How should I modify this code?
3. without changing the code segment, how can I modify the settings in php. ini to make the original program in 4.3.0 run normally in the 4.3.1 environment? This error message is not displayed.
Solution:
Add one sentence at the beginning of the program:
Error_reporting (E_ALL &~ E_NOTICE); or error_reporting (E_ALL ^ E_NOTICE); or modify php. ini error_reporting = E_ALL &~ E_NOTICE
Related error_reporting () functions:
Error_reporting () sets the PHP error level and returns the current level.
; Error reports are reported by bit. Or add the numbers to get the expected error report level.
; E_ALL-all errors and warnings
; E_ERROR-fatal runtime error
; E_WARNING-runtime warning (non-fatal error)
; E_PARSE-parsing error during compilation
; E_NOTICE-runtime reminder (these are often caused by bugs in your code,
It may also be caused by intentional behaviors. (For example, an uninitialized variable is automatically initialized to
; Use an uninitialized variable instead of an empty string)
; E_CORE_ERROR-fatal error during PHP startup Initialization
; E_CORE_WARNING-warning occurred during PHP startup initialization (non-fatal error)
; E_COMPILE_ERROR-fatal error during compilation
; E_COMPILE_WARNING-warning during compilation (non-fatal error)
; E_USER_ERROR-error message generated by the user
; E_USER_WARNING-user-generated warning message
; E_USER_NOTICE-user-generated reminder message
Usage:
Error_reporting (0); // Disable Error Reporting
Error_reporting (E_ALL ^ E_NOTICE); // display all error messages except E_NOTICE
Error_reporting (E_ALL ^ E_WARNING ^ E_NOTICE); // display all error messages except E_WARNING E_NOTICE
Error_reporting (E_ERROR | E_WARNING | E_PARSE); // displays a runtime error, which is the same as error_reporting (E_ALL ^ E_NOTICE. Error_reporting (E_ALL); // display all errors