Home >Backend Development >PHP Problem >How to cancel the error message displayed in php?

How to cancel the error message displayed in php?

coldplay.xixi
coldplay.xixiOriginal
2020-07-18 10:57:592670browse

How to cancel the error message displayed in php: 1. Configure the [error_reporting] command code in the php configuration file [php.ini]; 2. Add [error_reporting(0)] at the beginning of the php file; 3. , add the [@] symbol at the beginning of the action that may cause errors.

How to cancel the error message displayed in php?

How to cancel the error prompt in php:

There are several ways to cancel the error prompt:

1. Configure the error_reporting instruction code in the php configuration file php.ini as follows:

error_reporting = 
error_reporting = ~E_ALL

In this way, any errors that occur in php will not be printed out unless in php Configure manually in the file.

2. Add error_reporting(0) at the beginning of the php file, so that any errors in the php file will be ignored and will not be printed out in the browser:

error_reporting(0);

3. Add the "@" symbol at the beginning of an action that may cause errors. At this time, any errors that may occur in this action will be ignored and no longer prompted.

Related learning recommendations: PHP programming from entry to proficiency

The above is the detailed content of How to cancel the error message displayed 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