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

Answer Posted / mahesh role

$message : It is static variable
$$message : It is an dynamic variable

$Message = "YOU";
$you= "Me";

echo $message //Output:- you
echo $$message //output :-
//because the letter in Message and variable is not same

$Message = "you";
$you= "Me";

echo $message //Output:- you
echo $$message //output :-Me

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between session and cookies in php?

502


Is laravel better than codeigniter?

540


What is the default time of cookie in php?

530


How can we make a constant in php?

551


How can you declare the array in php?

517






What is string in php?

552


What is isset and unset in php?

532


What is move_uploaded_file in php?

540


What is mean by an associative array?

527


Which function is used in php to delete a file?

554


How to access a Static Member of a Class in PHP?

509


How cookies are transported from servers to browsers?

510


Tell me how do you define a constant?

518


Explain difference between urlencode and urldecode?

552


How to remove blank spaces from the string?

532