Home >> PHP >> What is the difference between $message and $$message in PHP

What is the difference between $message and $$message in PHP

$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.

Example

$Message = "Hello";
$Hello= "Raj";

echo $message //Output:- Hello
echo $$message //Output :-Raj

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

A variable of variable allows us to change the name of variable dinamically

Post Your Comment

Next Questions
What Is a Cookie
What Is a Persistent Cookie
What does a special set of tags do
What are tags type
How do you define a constant
How To Write the FORM Tag for Uploading Files
What is the difference between include, include_once
What is the difference between require and require_once
What is difference between include_once and require_once
What is difference between include and require
What is meant by urlencode and urldecode
How To Get the Uploaded File Information
Would I use print "$a dollars" or "{$a} dollars" to print out the amount of dollars
How do you pass a variable by value
How do I find out the number of parameters passed into function
How To Protect Special Characters in Query String
What is the difference between GET and POST
What are the different types of errors
If conditional statement
If else conditional statement
If else / else if conditional statement
Switch conditional statement
For loop
While loop
Do while loop

Copyright ©2022 coderraj.com. All Rights Reserved.