What is the method to suppress output errors in php

王林
Release: 2023-03-11 13:32:01
Original
2882 people have browsed it

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");
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!