WARNING level warning errors are non-fatal and do not affect subsequent code execution; closing method: add "error_reporting(E_ERROR);ini_set("display_errors","Off ");" That's it.
The operating environment of this tutorial: Windows 7 system, PHP version 7.1, DELL G3 computer
warning is an error level of PHP, it is non-fatal That is, after the warning occurs, subsequent scripts can still run normally.
Example: Create a new PHP document. Since the username and password for connecting data are incorrect, a WARNING warning error will be generated
WARNING level warning errors do not affect subsequent code execution
How to turn off warning in php Warning
Add
error_reporting(E_ERROR); ini_set("display_errors","Off");
at the beginning of the php page [Recommended learning: "PHP Video Tutorial"]
Related function introduction:
error_reporting() function specifies which error to report. This function sets the error reporting level for the current script. This function returns the old error reporting level.
error_reporting(report_level)
Parameter introduction:
report_level is optional. Specifies the error reporting level for the current script. Both value numbers and constant names are accepted, however, for compatibility with future PHP versions, it is recommended to use constant names.
For more programming-related knowledge, please visit: Introduction to Programming! !
The above is the detailed content of How to turn off warning warning in php. For more information, please follow other related articles on the PHP Chinese website!