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

How to turn off warning messages in php

青灯夜游
Release: 2023-03-09 15:04:02
Original
2338 people have browsed it

Method: 1. In the php.ini file, set the value of "display_errors" to "Off" and the value of "error_reporting" to "E_ALL"; 2. Add the "error_reporting(0)" statement at the beginning of the php file ;3. Use the error control operator "@".

How to turn off warning messages in php

The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer

Method 1: Modify php.ini The following attributes in the file

display_errors = Off
error_reporting = E_ALL
Copy after login

Method 2: Use the "error_reporting()" function at the beginning of the php file

error_reporting(0);
Copy after login

Method 3: You can use Error control operator "@" to mask errors

PHP supports an error control operator: @. When placed before a PHP expression, any error message that expression may produce is ignored.

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to turn off warning messages 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