Home > Backend Development > PHP Problem > How to turn off warning warning in php

How to turn off warning warning in php

青灯夜游
Release: 2023-03-08 14:50:01
Original
4558 people have browsed it

WARNING level warning errors are non-fatal and do not affect subsequent code execution; closing method: add "error_reporting(E_ERROR);ini_set("display_errors","Off ");" That's it.

How to turn off warning warning in php

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

warning is an error level of PHP, it is non-fatal That is, after the warning occurs, subsequent scripts can still run normally.

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

How to turn off warning warning in php

WARNING level warning errors do not affect subsequent code execution

How to turn off warning warning in php

How to turn off warning in php Warning

Add

error_reporting(E_ERROR); 
ini_set("display_errors","Off");
Copy after login

at the beginning of the php page [Recommended learning: "PHP Video Tutorial"]

Related function introduction:

error_reporting() function specifies which error to report. This function sets the error reporting level for the current script. This function returns the old error reporting level.

error_reporting(report_level)
Copy after login

Parameter introduction:

  • report_level is optional. Specifies the error reporting level for the current script. Both value numbers and constant names are accepted, however, for compatibility with future PHP versions, it is recommended to use constant names.

For more programming-related knowledge, please visit: Introduction to Programming! !

The above is the detailed content of How to turn off warning warning 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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template