Tuesday, November 20, 2018

variable variables - what is "$$" in PHP



I saw this code




if (is_null($$textVarName)) {
$$textVarName = $_defaultTexts[$type];
}


what is code "$$" ?


Answer



It's evil is what it is.




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"

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...