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 check if a string contains a character or word in php?
How do you end php?
What is a php 5?
Who is known as the father of php?
Is php class name case sensitive?
Why use static methods php?
What does csrf token mean?
Tell me will a comparison of an integer 12 and a string "13" work in php?
What are php data types?
What is mysql_real_escape_string used for?
What is action hooks and filter hooks?
What is urlencode and urldecode in php?
What are properties in php?
what is constructor
How can I convert ereg expressions to preg in php?