Home > Backend Development > PHP Tutorial > php error shield

php error shield

王林
Release: 2023-04-07 14:46:02
Original
2787 people have browsed it

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")
Copy after login

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]);
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template