|
PHP复制代码
foreach (array($_GET, $_POST, $_COOKIE, $_SERVER, $_FILES, $_ENV, (isset($_SESSION) && is_array($_SESSION)) ? $_SESSION : array()) as $global)
{
if ( ! is_array($global))
{
if ( ! in_array($global, $protected))
{
unset($GLOBALS[$global]);
}
}
else
{
foreach ($global as $key => $val)
{
if ( ! in_array($key, $protected))
{
unset($GLOBALS[$key]);
}
if (is_array($val))
{
foreach($val as $k => $v)
{
if ( ! in_array($k, $protected))
{
unset($GLOBALS[$k]);
}
}
}
}
}
}
复制代码 |
|