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

Answers were Sorted based on User's Feedback



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

Answer / prasad

$message is variable and $$message is variable variable.
$message="hello";
$$message="world";
echo $hello; // prints world
echo ${$message} //prints world

variable variable cant be used in php superglobalarray. and
cant use in functions and within classes

Is This Answer Correct ?    25 Yes 6 No

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

Answer / sakthivel

$var1 = "hello world";
$var2 = $var1;
$$var2 = "hello world";

Is This Answer Correct ?    6 Yes 2 No

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

Answer / vikram

$message="hello";
$hello="world";
echo $$message;
// will print "world"..this concept is called "variable of
variables"...

Is This Answer Correct ?    6 Yes 3 No

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

Answer / mohit

$message is a variable and $$message is a refrence variable
that have the refrence of $message.

Is This Answer Correct ?    5 Yes 2 No

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

Answer / laxmikanta pradhan

$message is variable and $$message is variable variable i.e.
$message is a variable whereas $$message is a refrence
variable having the refrence of $message.
Ex. $message="hello";
$$message="world";
echo $hello; // prints world
echo ${$message} //prints world

Is This Answer Correct ?    3 Yes 0 No

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

Answer / abhilash

if $message1 = "hello";
and $message = "message1";
den $$message = hello

Is This Answer Correct ?    6 Yes 9 No

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

Answer / keshab

$test = "example";
$temp = "test";

echo $temp // output is "test";
echo $$temp// output is "example";

thanks

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More PHP Interview Questions

Explain the difference between array_merge() and array_combine()?

0 Answers  


Why super () is used in java?

0 Answers  


Tell me how to execute an sql query? How to fetch its result?

0 Answers  


Which function will you use to create an array?

0 Answers  


What is get and post method in php?

0 Answers  






What is php dependency injection?

0 Answers  


What is .htaccessfile and use of this file

5 Answers  


What is inheritance in php?

0 Answers  


How to convert the first character to upper case?

0 Answers  


How do you add a joomla Template in admin panel of joomla? Please mention the steps

3 Answers   Cognizant, T3 Softwares,


Explain Booleans in PHP?

0 Answers  


if i give Limit for mysql query through php command line script like this for ex. $limit=500; $total_items = 1500; for($start=0;$start<$total_items;){ $command = "/usr/bin/php -q /home/sitename/public_html/admin/feedmanager/test.php feedid ".$_GET['feedid']." start ".$start." end ".$limit ; $start = $start+$limit; $command_result = system($command); } so it's execute command for 3 times so it give limit to sql query but if i have 27000 data so it takes long time? so my question is that is that any way from php command line script that i can use for collect all the data at once?

0 Answers  


Categories