Home >Backend Development >PHP Tutorial >PHP batch filter posts, get sensitive data_PHP tutorial

PHP batch filter posts, get sensitive data_PHP tutorial

WBOY
WBOYOriginal
2016-07-20 11:06:421096browse

php 批量过滤post,get敏感数据

if (get_magic_quotes_gpc()) {
    $_GET = stripslashes_array($_GET);
 $_POST = stripslashes_array($_POST);
}

function stripslashes_array(&$array) {
  while(list($key,$var) = each($array)) {
   if ($key != 'argc' && $key != 'argv' && (strtoupper($key) != $key || ''.intval($key) == "$key")) {
    if (is_string($var)) {
     $array[$key] = stripslashes($var);
    }
    if (is_array($var))  {
     $array[$key] = stripslashes_array($var);
    }
   }
  }
  return $array;
 }


www.bkjia.comtruehttp://www.bkjia.com/PHPjc/445021.htmlTechArticlephp 批量过滤post,get敏感数据 if (get_magic_quotes_gpc()) { $_GET = stripslashes_array($_GET); $_POST = stripslashes_array($_POST); } function stripslashes_array($array) { w...
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