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

What is the php function that removes the last element of the array and returns it?

506


Which function you can use in php to open a file for reading or writing or for both?

553


What is a php session?

568


Explain how we can retrieve the data in the result set of mysql using php?

500


How we can retrieve the data in the result set of mysql using php?

522






How to open a file for writing?

560


What are interfaces in php?

515


What is the difference between require and include in php?

508


Does php have future?

576


How do you find the length of a string in php?

512


Why is used in php?

526


How long is session timeout?

528


What is the difference between php traits vs interfaces?

484


Which php framework is best for security?

518


Why use php artisan serve?

501