Home>Article>Backend Development> How to turn off warning messages in php

How to turn off warning messages in php

青灯夜游
青灯夜游 Original
2021-05-10 13:54:44 2218browse

Method: 1. In the php.ini file, set the value of "display_errors" to "Off" and the value of "error_reporting" to "E_ALL"; 2. Add the "error_reporting(0)" statement at the beginning of the php file ;3. Use the error control operator "@".

How to turn off warning messages in php

The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer

Method 1: Modify php.ini The following attributes in the file

display_errors = Off error_reporting = E_ALL

Method 2: Use the "error_reporting()" function at the beginning of the php file

error_reporting(0);

Method 3: You can use Error control operator "@" to mask errors

PHP supports an error control operator: @. When placed before a PHP expression, any error message that expression may produce is ignored.

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to turn off warning messages 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