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
Does facebook use php framework?
Is multilevel inheritance possible in php?
What is php session start?
What is purpose of @ in Php?
How to check an element is exists in array or not in php?
What is php explain?
What are the different types of PHP arrays?
How is csrf token generated?
What is the use of namespace in php?
When a conditional statement is ended with an endif?
Explain the casts allowed in PHP?
Explain me what is the use of 'print' in php?
What can php do?
How do you pass a variable by value in php?
What is the difference between get and post in php?