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);".
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
Create a new PHP document. Since the username and password for connecting to the data are incorrect, a WARNING warning error will be generated
Warning level warning errors are non-fatal and do not affect subsequent code execution
Use the error_reporting() function to turn off warning warnings Error, example:
error_reporting(E_ALL^E_WARNING);
After setting, the PHP script will ignore this error, and the subsequent code will execute normally
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!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

Dreamweaver CS6
Visual web development tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version
Useful JavaScript development tools

Notepad++7.3.1
Easy-to-use and free code editor

Atom editor mac version download
The most popular open source editor
