Home > Backend Development > PHP Tutorial > What does undefined mean? Summary of ways to solve undefined index in php.

What does undefined mean? Summary of ways to solve undefined index in php.

WBOY
Release: 2016-07-29 08:40:21
Original
2947 people have browsed it

1. Modify

error_reporting = E_ALL

in the php.ini file to

error_reporting = E_ALL & ~E_NOTICE

2. Use the code

ini_set( 'error_reporting', E_ALL ^ ​​E_NOTICE );

ini_set ( 'display_errors', '0′ );

3. Use @ to suppress errors

@$name = $_GET['name'];

4. Make judgments

if( !empty($ _GET['name']) ) $name = $_GET['name'];

The above introduces what undefined means and a summary of PHP's methods to solve undefined index. , including the meaning of undefined, I hope it will be helpful to friends who are interested in PHP tutorials.

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