Variables are used for storing data, such as numbers or strings, so that they can be used multiple times in a script.
A variable starts with a dollar sign ($) followed by an identifier , which is the name of the variable. A common naming convention for variables is to have each word initially capitalized, except for the first one.
A value can be assigned to a variable by using the equals sign, or assignment operator (=). The variable then becomes defined or initialized .
$myVar = 10;
Once a variable has been defined it can be used by referencing the variable’s name. For example, the value of the ...