PHP 7.2.0 Beta 1 Released

Voting

Please answer this simple SPAM challenge: six plus three?
(Example: nine)

The Note You're Voting On

Carel Solomon
12 years ago
You can also construct a variable name by concatenating two different variables, such as:

<?php

$arg
= "foo";
$val = "bar";

//${$arg$val} = "in valid";     // Invalid
${$arg . $val} = "working";

echo
$foobar;     // "working";
//echo $arg$val;         // Invalid
//echo ${$arg$val};     // Invalid
echo ${$arg . $val};    // "working"

?>

Carel

<< Back to user notes page

To Top