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

How to turn off warning errors in php

Guanhui
GuanhuiOriginal
2020-05-05 13:52:484197browse

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!

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