Variables are used to store information or a value to its like in text of string, numbers, etc. Like other programming languages PHP have its own variables. But in PHP there is no need to define there data type.
In PHP variables are define by a dollar sign follow by the name of the variables. The variables name is case-sensitive i.e.
$a, $abc etc.
The first character after $ must be character or underscore. The remaining character in name may be letter , number or underscore.
$variable_name = value; Example: $a $a=10; $b=20; $c= $a+$b; echo $c // output 30 $a = "Pankaj"; $b= "Sugara"; echo "$a , $b"; //Output Pankaj Sugara
In PHP, variables are always assigned by values. PHP also offers another way to assign the valyue by refrece. Blew are the examples of assign by value and assigh by refernce in PHP
$var1 = "India"; // this is assign by value to variable $var2 = &$var1; // this is refrence $var1 by $var2 echo $var2; // Output : India echo $var1; // Outut : India