Article From:https://www.cnblogs.com/solvit/p/9967414.html

problem

  Notice:NoticePHP Tips rather than errors,PHPIt can be used directly without declaring variables beforehand, but there are hints for undeclared variables. When the website is officially launched, the prompt will be turned off.


Ways to turn off PHP prompts

searchphp.ini

error_reporting = E_ALL

changed to:

error_reporting = E_ALL & ~E_NOTICE

There is another way not to do that.

Add on each file header

error_reporting(0);

It’s not easy, but it can solve problems.”


<span style="font-size:18px;">
<?php
//disable error reporting
error_reporting(0);
//Report all errors except warnings
error_reporting(E_ALL & ~E_NOTICE);
//Reporting runtime errors
error_reporting(E_ERROR | E_WARNING | E_PARSE);
//Report all errors
error_reporting(E_ALL);
?></span>

 

Link of this Article: Notice appears in PHP running

Leave a Reply

Your email address will not be published. Required fields are marked *