What is the difference between $message and $$message ?

Answer Posted / prasad

$message is variable and $$message is variable variable.
$message="hello";
$$message="world";
echo $hello; // prints world
echo ${$message} //prints world

variable variable cant be used in php superglobalarray. and
cant use in functions and within classes

Is This Answer Correct ?    25 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What software is required to run php?

542


The left association operator % is used in PHP for?

576


What is purpose of @ in Php?

657


What are default session time and path?

559


What is Gd PHP?

582






Explain how to run the interactive php shell from the command line interface?

549


Write down the code for save an uploaded file in php.

530


what is PDO?

799


Explain me what is the use of 'print' in php?

528


What is the difference between $var and $$var?

550


What is the purpose of constant() function?

515


What is php oop?

512


How to assigning a new character in a string using php?

539


What is x+ mode in fopen() used for?

559


How many types of errors in php?

564