Home >Backend Development >PHP Tutorial >What does php $$ mean_PHP Tutorial

What does php $$ mean_PHP Tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-13 10:52:421280browse

foreach(array('_COOKIE', '_POST', '_GET') as $_request) {
foreach($$_request as $_key => $_value) {
                  $_key{0} != '_' && $$_key = daddslashes($_value);
}
}
$_request is a built-in variable in PHP, right? What does $$_request mean

The ones in uppercase letters are PHP’s super global variables
$_REQUEST
In the above code, $_request is a normal variable

$$_request means to use the value of $_request as the variable name!
For example:

<font face="新宋体">$name = 'blueidea';<code id="code0"><font face="新宋体">$name = 'blueidea';<br> $$name 就相当于  $blueidea</font> $$name is equivalent to $blueidea

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632476.htmlTechArticleforeach(array('_COOKIE', '_POST', '_GET') as $_request) { foreach($ $_request as $_key = $_value) { $_key{0} != '_' $$_key = daddslashes($_value); } } $_request is a built-in variable of PHP...
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