$message vs. $$message in PHP.


PhpPHP Interview Questions

$message is a variable with a fixed name. $$message is a variable whose name is stored in $message.

For example:

$Message means simple variable store data.
$$Message means variable variable.
That is, a variable name which can be set and used dynamically
$Message = ‘hello’;

print $Message; // print hello

$$Message = ‘world’;

means $hello =’world’;

now if u print $$Message;
menas $hello;// print world;

if u print $Message $($Message); // print hello world;