Home >Backend Development >PHP Tutorial >看这段简单的代码?

看这段简单的代码?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-23 13:48:14902browse

session_start();
$globals = array($_REQUEST, $_SESSION, $_SERVER, $_FILES);
foreach ($globals as $global) {
foreach(array_keys($global) as $key) {
unset(${$key});  //这行是什么意思,就是那个${$key}   高手来看看
}
}


回复讨论(解决方案)

查看手册:变量的变量

能说具体点吗,变量的变量,谁的变量的变量

$key = 'str';
${$key}  => $str

$key = "heh";$heh ="woshi";echo $$key;//输出 woshi
 

就是php的可变变量
如果不懂的话可以百度一下
例子:

$a='abc';$abc='def';echo $$a;

我都忘记了,真是的,

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