Home > php教程 > php手册 > PHP中提示Notice: Undefined index 的解决方法

PHP中提示Notice: Undefined index 的解决方法

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 19:44:43
Original
1961 people have browsed it

Notice : Undefined index: message in D:\PHPnow-1.5.1\PHPnow-1.5.1\htdocs\Zhongcaoyaocode\index.php on line 4 Notice : Undefined variable: contents in D:\PHPnow-1.5.1\PHPnow-1.5.1\htdocs\Zhongcaoyaocode\index.php on line 32 Notice : Use of

Notice: Undefined index: message in D:\PHPnow-1.5.1\PHPnow-1.5.1\htdocs\Zhongcaoyaocode\index.php on line 4

Notice
: Undefined variable: contents in D:\PHPnow-1.5.1\PHPnow-1.5.1\htdocs\Zhongcaoyaocode\index.php on line32

Notice: Use of undefined constant id - assumed 'id' inD:\PHPnow-1.5.1\PHPnow-1.5.1\htdocs\Zhongcaoyaocode\index.php on line33


为了方便程序修改,可以用以下方法:

在开头加上 
error_reporting(E_ALL & ~E_NOTICE); // 这句话表示提示除去 E_NOTICE 之外的所有错误信息 

或者在每个文件头上加

error_reporting(0);

这样以来,Notice信息就不再显示了。

Related labels:
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 Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template