Close method: 1. In the php.ini file, change the value of the "error_reporting" item to "E_ALL & ~E_NOTICE"; 2. Add "error_reporting(E_ALL^) to the page where notice prompts need to be disabled. E_NOTICE);" code.
Recommended: "PHP Video Tutorial"
PHP's Notice error message level is not fatal, even if it occurs Wrong, the script will not stop running, so how to turn off the notice-level error prompt? The following article will introduce it to you.
Notice is caused by using an undefined variable or array index; for example, accessing an undefined variable or array index.
php closes notice-level error prompts
Method 1. Modification php.ini configuration file
Change error_reporting
in the php.ini file to:
error_reporting = E_ALL & ~E_NOTICE
Method 2. Use error_reporting in the PHP file () function
If you cannot operate the php.ini file, you can use the following method
Add the following code to the page where you want to disable notice error prompts:
error_reporting(E_ALL^E_NOTICE);
or
error_reporting(0);
For more programming-related knowledge, please visit:Introduction to Programming! !
The above is the detailed content of How to turn off notice level error prompts in php?. For more information, please follow other related articles on the PHP Chinese website!