Home >Backend Development >PHP Tutorial >何位大咖知道这段代码是做什么的

何位大咖知道这段代码是做什么的

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 11:17:02878browse

哪位大咖知道这段代码是做什么的?
哪位大咖知道这段代码是做什么的?

<br />        $superglobal = array(<br />				'GLOBALS' => 1,<br />				'_GET' => 1,<br />				'_POST' => 1,<br />						'_COOKIE' => 1,<br />				'_SERVER' => 1,<br />				 		'_FILES' => 1,<br />		);<br />		foreach($GLOBALS as $k=>$v) {<br />			if(!isset($superglobal[$k])) {<br />				$GLOBALS[$k] = null; unset($GLOBALS[$k]);<br />			}<br />		}

PHP
------解决方案--------------------
superglobal在这里当了一个过滤器

过滤掉global里面的一些变量,

执行后GLOBALS只保留GLOBALS,_GET_POST_COOKEI,_SERVER _FILES
------解决方案--------------------
删除全局变量,不包括在 $superglobal 中指定的
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