Home > php教程 > php手册 > php Undefined variable和 Undefined index

php Undefined variable和 Undefined index

WBOY
Release: 2016-05-25 16:53:12
Original
969 people have browsed it

undefined variable和 undefined index:出现这种问题是变量未定义了,我们只要把加个验证如

$a =isset($_get['aa'])?$_get['aa']:'变量未定义';

这样未定义变量也不会出现undefined variable和undefined index提示,同时我们还提供在php ini或在php中设置错误不提示的方法。

解决方法: 

1) error_reporting设置:找到error_reporting = e_all 

修改为error_reporting = e_all & ~e_notice

2) register_globals设置:找到register_globals = off 

修改为register_globals = on

教程链接:

随意转载~但请保留教程地址★

Related labels:
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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template