What is the difference between $message and $$message?

Ads

 
 

Share on Google+Share on Google+

brijesh
What is the difference between $message and $$message?
1 Answer(s)      6 years and 11 months ago
Posted in : PHP

What is the difference between $message and $$message?

Ads
View Answers

November 13, 2010 at 3:45 PM


$Message = "first";
$first= "second";

echo $message //Output   first
echo $$message //output  second

It means $message is a variable and $$Message is variable of variable

A variable of variable allows us to change the name of variable dynamically.

Thanks


Ads









Related Tutorials/Questions & Answers:
Advertisements

Ads

 
Advertisement null

Ads