What is the difference between $message and $$message?
Answer Posted / 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 |
Post New Answer View All Answers
How to get the IP address of the client/user in PHP?
Tell me is it possible to submit a form with a dedicated button?
What is difference between readonly and constant?
What type of comments are supported by PHP.
What is polymorphism in oop php?
Write a program to display reverse of any number?
What is meant by variable variables in php?
Tell me how to create a text file in php?
How to define a user function?
What is the main difference between asp net and php?
What is the major php security hole? How to avoid?
Explain the installation of PHP on UNIX systems?
Is php required for wordpress?
What is php programming used for?
List functions available to sort an php array?