Home >Backend Development >PHP Problem >What is the method to suppress output errors in php
The way to disable error output in php is to add the code [ini_set("error_reporting", "E_ALL & ~E_NOTICE");] to the header of the file. E_NOTICE is a runtime attention message.
The operating environment of this article: windows10 system, php 7.3, thinkpad t480 computer.
If we want to block all page output errors, then we can add the following line of code to the header of the file
ini_set("error_reporting","E_ALL & ~E_NOTICE");
The ini_set function sets the value for a configuration option. This option will retain its new value while the script is running, and will be restored when the script ends.
E_NOTICE Runtime attention message (may or may not be a problem)
E_ERROR Fatal runtime error (prevents script execution)
Related video tutorial sharing:php video tutorial
The above is the detailed content of What is the method to suppress output errors in php. For more information, please follow other related articles on the PHP Chinese website!