PHP message

PHP message - August 21, 2008 at 22:00 pm by Rajmeet Ghai

Explain the difference between $message and $$message?

$message is used to store variable data. $$message can be used to store variable of a variable. Data stored in $message is fixed while data stored in $$message can be changed dynamically.

E.g. $var1 = ‘Variable 1’
$$var1= ‘variable2’
This can be interpreted as $ Variable 1=‘variable2’;

For me to print value of both variables, I will write
$var1 $($var1)

PHP message - October 01, 2009 at 17:00 pm by Vidya Sagar

Explain the difference between $message and $$message in PHP

$message is a variable and $$message is a variable of another variable. For example

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

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

$$message allows the developer to change the name of the variable dynamically.


Write your comment - Share Knowledge and Experience

Related PHP links 

How to set cookies in PHP?

Answer - Cookies are often used to track user information.............

What is the difference between include and require?

Answer - Require () and include () are the same with respect to handling failures.............

What is urlencode and urldecode?

Answer - Urlencode can be used to encode a string that can be used in a url.............

What are the different types of errors in PHP?

Answer - Different types of errors are............

Latest placement tests
Latest links
Latest MCQs
» General awareness - Banking » ASP.NET » PL/SQL » Mechanical Engineering
» IAS Prelims GS » Java » Programming Language » Electrical Engineering
» English » C++ » Software Engineering » Electronic Engineering
» Quantitative Aptitude » Oracle » English » Finance
Home | About us | Sitemap | Contact us