时间:2021-07-01 10:21:17 帮助过:2人阅读
PHP
$superglobal = array(
'GLOBALS' => 1,
'_GET' => 1,
'_POST' => 1,
'_COOKIE' => 1,
'_SERVER' => 1,
'_FILES' => 1,
);
foreach($GLOBALS as $k=>$v) {
if(!isset($superglobal[$k])) {
$GLOBALS[$k] = null; unset($GLOBALS[$k]);
}
}