Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

What is an abstract class in php?

0 Answers  


Which method removes the last element from the end of an array?

0 Answers  


Which functions are used to count the total number of array elements in php?

0 Answers  


Write a PHP code to print following number pattern: 123 456 789

5 Answers  


How does php session work?

0 Answers  


Does php pass arrays by reference?

0 Answers  


What is a path Traversal?

0 Answers  


How to implement a class named dragonball. This class must have an attribute named ballcount (which starts from 0) and a method ifoundaball. When ifoundaball is called, ballcount is increased by one. If the value of ballcount is equal to seven, then the message you can ask your wish is printed, and ballcount is reset to 0. How would you implement this class?

1 Answers  


How variables are passed through arguments?

0 Answers  


Tell me what is the main difference between php 4 and php 5?

0 Answers  


What is difference between echo and print in php?

0 Answers  


What's the best method for sanitizing user input with php?

0 Answers  


Categories