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

Answer Posted / laxmikanta pradhan

$message is variable and $$message is variable variable i.e.
$message is a variable whereas $$message is a refrence
variable having the refrence of $message.
Ex. $message="hello";
$$message="world";
echo $hello; // prints world
echo ${$message} //prints world

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to process the uploaded files?

586


What is meant by urlencode and urldecode?

604


What is difference between echo and print_r in php?

495


What is htaccess? Why do we use this and where?

496


What is difference between sql and php?

544






How to redirect https to http url and vice versa in .htaccess?

513


How to create a session? How to set a value in session?

517


Does php support function overloading?

562


Inside a php function, what param needs to be set in order to access a global variable?

537


What is cakephp framework?

530


Why is php used for web development?

497


is that "enumerated array" equal to "numeric array"?

2022


What is the difference between require_once and require in php?

553


Why super () is used in java?

528


Why namespace is used in php?

541