meo*_*hia 13 php variable-variables
我看到了这段代码
if (is_null($$textVarName)) {
$$textVarName = $_defaultTexts[$type];
}
Run Code Online (Sandbox Code Playgroud)
什么是代码"$$"?
Vot*_*ple 33
这就是它的邪恶.
这将采用其中的值$textVarName并将其用作变量名称.例如:
$foo = 'hello';
$hello = 'The Output';
echo $$foo; // displays "The Output"
Run Code Online (Sandbox Code Playgroud)