什么是"$$"在PHP中 [英] what is "$$" in PHP

查看:100
本文介绍了什么是"$$"在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆