Home >Backend Development >PHP Tutorial >How to fix the Undefined index error in PHP

How to fix the Undefined index error in PHP

WBOY
WBOYOriginal
2016-07-25 09:05:221193browse
  1. function _get($str){
  2. $val = !empty($_GET['str']) ? $_GET['str'] : null;
  3. return $val;
  4. }
  5. ?>
Copy the code

Use _get('str') directly instead of $_GET['str'].



Statement:
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