search
HomeBackend DevelopmentPHP ProblemHow to eliminate alert in php

php method to eliminate alerts: First create a PHP sample file; then use the "error_reporting()" function to turn off the warning error, with a code such as "error_reporting(E_ALL^E_WARNING);".

How to eliminate alert in php

The operating environment of this article: Windows 7 system, PHP version 7.1, DELL G3 computer

Common reasons for WARNING errors in PHP:

Cannot connect to the database

How to eliminate alert in php

Create a new PHP document. Since the username and password for connecting to the data are incorrect, a WARNING warning error will be generated

How to eliminate alert in php

Warning level warning errors are non-fatal and do not affect subsequent code execution

How to eliminate alert in php

Use the error_reporting() function to turn off warning warnings Error, example:

error_reporting(E_ALL^E_WARNING);

How to eliminate alert in php

After setting, the PHP script will ignore this error, and the subsequent code will execute normally

How to eliminate alert in php

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to eliminate alert 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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

Atom editor mac version download

Atom editor mac version download

The most popular open source editor