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

Tell me how stop the execution of a php scrip?

524


Does php need html?

532


How does firefox manage cookies?

540


What is $_ get in php?

609


How is it possible to set an infinite execution time for php script?

520






Do you know what is the use of the function 'imagetypes()'?

497


Does mysql need php?

452


What is the use of @ in php?

547


How to create database connection and query in php?

574


Difference between get and post method.

545


What are the different components used in php for formatting?

533


How to calculate the difference between two dates using php?

545


How are sessions maintained?

537


Is php used for frontend or backend?

528


What is exception handling in php?

1077