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 "@".
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!