PHP $ And $$
PHP $ and $$ in this article we will discuss about difference between $ and $$.
PHP $
$ (single dollar) in php is used to store data in a variable like string, integer, double etc..
$ is used with variable name.
Syntax :
$ variable_name = value
Program :
Output :
NibKarma
10
25.89
As we can see in above program we use $ sign for store the values like string, integer and float in the variable. after that we print it.
PHP $$
$$ (double dollar) in php is used as a reference variable for store value of $variable in it.
$$ is used with variable name.
if we write as a $$abc then it stores value of $abc.
For Example :
$abc = "a";
$$abc = 20;
It means $($abc) = $(a) = 20.
We are here store variable of variable in it.
Syntax :
$ variable_name = value
$$ variable name = value
Program :
Output :
Number is : 12
Square of number is : 144
As we can see in program we take a variable a and we store value in a is 12.
After that we take a $$a which means $($a)=$(12) and we store $12 value is 144.
If we print $12 instead of $$a it returns same output 144.
Let's see an example.
Program :
Output :
abc
10
10
As we can see $$a and $abc will print the same output.
It work as,
$a = abc
$$a = $abc = 10
Program :
Output :
fruit
grapes
green
grapes
green
green
Here, in this program we store variable to the $$$ (three dollar). it means a stores fruit value, fruit stores grapes and grapes stores green value.
It works as,
$a = fruit
$$a = $fruit = grapes
$$$a = $$fruit = $grapes = green.
We can print values using different method.
In this article we discuss about use of $ and $$ and also we learn how it works.
Mesothelioma Survival Rates , Mesothelioma Attorneys California , Seattle Mesothelioma Lawyer , Mesothelioma Suit , Mesothelioma Claim , Wisconsin Mesothelioma Attorney , Mesothelioma Attorney illinois , Mesothelioma Trial Attorney ,Houston Mesothelioma Attorney , Mesothelioma Lawyer Dallas , New York Mesothelioma Law Firm,Mesothelioma Lawyer Asbestos Cancer Lawsuit , Mesothelioma Lawyers San Diego,Mesothelioma Litigation , Mesothelioma Attorney Assistance , Mesothelioma Lawyer Asbestos Cancer Lawsuit , Mesothelioma Lawyer Chicago , New York Mesothelioma Law Firm ,
Houston Mesothelioma Attorney , Mesothelioma Lawyer Dallas , Mesothelioma Care , Mesothelioma Trial Attorney , Mesothelioma Lawyer Texas , Lawsuit Mesothelioma , Truck Accident Attorney Los Angeles ,Asbestos Exposure Lawyers , Mesothelioma Cases , Emergency Response Plan ppt , Mesothelioma Lawyers San Diego , Asbestos Mesothelioma Lawsuit , Tennessee Mesothelioma Lawyer , Meso Lawyer , Mesothelioma Settlements Amounts , Mesothelioma Law Firms , New Mexico Mesothelioma Lawyer , Accident Attorneys Orange County , Mesothelioma Lawsuit ,Personal Injury Accident Lawyer , Purchase Structured Settlements , Firm Law Mesothelioma , Car Accident Lawyers Los Angeles , Mesothelioma Attorneys , Structured Settlement Company , Auto Accident Lawyer San Francisco , Mesotheolima , Los Angeles Motorcycle Accident Lawyer
Mesothelioma , Mesothelioma Lawyer Virginia , Seattle Mesothelioma Lawyer , Mesothelioma Attorney illinois , Mesothelioma Drug , Mesothelioma Attorney DirectoryMesothelioma Settlements , Mesothelioma Help , Mesothelioma ct , Mesothelioma Attorney Florida , Washington Mesothelioma Attorney , Best Mesothelioma Lawyers , Diagnosed With Mesothelioma , Mesothelioma Settlement Amounts , Mesothelioma Personal Injury Lawyers , Mesothelioma Compensation , Attorney Lawyer Mesothelioma ,Colorado Mesothelioma Lawyers,Mesothelioma Lawsuits , Mesothelioma Claims , Average Mesothelioma Settlement , Average Mesothelioma Settlement , Mesothelioma Law Suit , Alabama Mesothelioma Lawyer , alabama Mesothelioma Lawyer , utah mesothelioma lawyer , Dallas Mesothelioma Lawyer , Mesothelioma Attorney California , Mesothelioma Lawyer California ,Mesothelioma Survival Rates ,
Mesothelioma Attorneys California, Wisconsin Mesothelioma Attorney Mesotheliama , Mesothelioma Lawyer Virginia , Seattle Mesothelioma Lawyer , Mesothelioma Attorney illinois, Mesothelioma Trial Attorney Injury Lawyer Houston tx , Baltimore Mesothelioma Attorneys , Mesothelioma Care ,Mesothelioma Trial Attorney ,Mesothelioma Lawyer Texas , Mesothelioma Lawyer Dallas , Mesothelioma Care , Mesothelioma Trial Attorney , Mesothelioma Lawyer Texas , California Mesothelioma Attorney Philadelphia Mesothelioma Lawyer , Illinois Mesothelioma Lawyer , Mesothelioma Attorney , Mesothelioma Claims , Average Mesothelioma Settlement
Integrated ehr , Mesothelioma Law Sui , Mesothelioma Lawyer California,Mesothelioma Attorney California ,Mesothelioma Law Suits ,Dallas Mesothelioma Attorneys ,Mesothelioma Drug ,Mesothelioma Attorney Directory