Home > Article > Backend Development > How to turn off warning errors in php
php method to turn off warnings
1. You can use the "error_reporting()" function to set the error reporting level of the current script to "E_ALL&~E_WARNING" level means to display all errors except warning level errors;
error_reporting(E_ALL&~E_WARNING)
error_reporting - Set what kind of PHP errors should be reported
2. You can use the error control operator "@" to block errors.
PHP supports an error control operator: @. When placed before a PHP expression, any error message that expression may produce is ignored.
The above is the detailed content of How to turn off warning errors in php. For more information, please follow other related articles on the PHP Chinese website!