Home  >  Article  >  Backend Development  >  php error shield

php error shield

王林
王林Original
2019-10-11 17:45:132742browse

php error shield

PHP shields error prompts

Method 1:

Before the function that may cause errors Add @, then or die("")

such as:

@mysql_connect(...) or die("Database Connect Error")

Method 2

Edit php.ini, search for "display_errors=", and change the value after "=" to "off.

Method 3:

In Add error_reporting(0) before the php script to block all error prompts.

Among them, error_reporting configures the level of error information reporting.

Syntax:

int error_reporting(int [level]);

Return value: Integer

Recommended tutorial: PHP video tutorial

The above is the detailed content of php error shield. 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