什么是"$$"在PHP中 [英] what is "$$" in PHP
本文介绍了什么是"$$"在PHP中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我看到了这段代码
if (is_null($$textVarName)) {
$$textVarName = $_defaultTexts[$type];
}
什么是代码"$$"?
what is code "$$" ?
推荐答案
这是邪恶的.
这将采用$textVarName
中的值并将其用作变量名.例如:
That will take the value that's in $textVarName
and use that as a variable name. For example:
$foo = 'hello';
$hello = 'The Output';
echo $$foo; // displays "The Output"
这篇关于什么是"$$"在PHP中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文