How to eliminate alert in php

藏色散人
Release: 2023-03-09 22:18:01
Original
1958 people have browsed it

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

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!

Related labels:
php
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!