What is the difference between $message and $$message?
Answers were Sorted based on User's Feedback
Answer / umesh ms analytica-india
$message = "ume";
$ume = "All Interview dot com";
echo $message; // Output: ume
echo $$message; // Output: All Interview dot com
| Is This Answer Correct ? | 98 Yes | 9 No |
Answer / darshit
$Message = "YOU";
$you= "Me";
echo $message //Output:- you
echo $$message //output :-Me
It means
$message is a variable and
$$Message is variable of variable
A variable of variable allows us to change the name of
variable dinamically
| Is This Answer Correct ? | 73 Yes | 10 No |
Answer / seema
$message is a simple variable and $$message is variable of a
variable(also known as dynamic variable).
For Example:
$message = "welcome";
$welcome = "to php programming tricks!!!";
echo $message; // Output: welcome
echo "<br>",$$message; // Output: to php programming tricks!!!
You will notice with the second echo it will check the
variable $message for it's value and it's value is the
string "welcome". So then it searches for $welcome and finds
the final value which it yields.
| Is This Answer Correct ? | 12 Yes | 1 No |
Answer / king
People are here to find solution to their problems not to
see babies fight with one another
| Is This Answer Correct ? | 11 Yes | 3 No |
Answer / deepak tiwari
$message is variable and $$message is the variable of the
variable
| Is This Answer Correct ? | 8 Yes | 0 No |
Answer / mani
Hi peter This forum is for finding solutions. Not for
checking our Vocabulary
| Is This Answer Correct ? | 5 Yes | 0 No |
Answer / mahesh role
$message : It is static variable
$$message : It is an dynamic variable
$Message = "YOU";
$you= "Me";
echo $message //Output:- you
echo $$message //output :-
//because the letter in Message and variable is not same
$Message = "you";
$you= "Me";
echo $message //Output:- you
echo $$message //output :-Me
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / saravanan
$message is a simple variabla.
$$message is variabla of variable(dynamic)
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / peter
Hi Peter ,
You may be the world number one english master ,
But dont loose your words in forums , it make very big pains ,
sorry my dear peter ,
Sorry to all
| Is This Answer Correct ? | 6 Yes | 7 No |
How to create a text file in PHP?
find highest salary
To run php script on a local machine we need to install Apache http server and php. Then only scripts are run in the browsers. but when these things are not loaded on a local machine and a php script is brought by the browser still the browser displays the page. how?
Is it possible to submit a form with a dedicated button?
for image work which library?
Is PHP runs on different platforms (Windows, Linux, Unix, etc.)?
Can the value of a constant change during the script's execution?
i want to store retrieved data from database into an array list with limit.And display the data from that array list.have any answer for this?
Explain Magento's autoload functionality and how to instantiate classes? What is the process you take when theming a store? Talk about Magento collections and how you use them?
Difference between $message vs. $$Message in php.
Why many companies are switching their current business language to php? Where php basically used?
Steps for the payment gateway processing?