Home  >  Article  >  Backend Development  >  What is the method to suppress output errors in php

What is the method to suppress output errors in php

王林
王林Original
2021-07-13 14:00:212908browse

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.

What is the method to suppress output errors in php

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn