Variables are used for lots of things
counting loops:
PHP Code:
foreach($x=1; $x < 10; $x++)
{
echo $x.'<br/>';
}
Storing valuable data
Imagine you have a code that's long and complecated and is necessary to keep perfect, you could easily make a mistake typing it out a second time, so using a short variable name makes it quicker.
Function parametres
when writing a function, you can input parametres which when become variables inside the function.
PHP Code:
function dostuff($name, $age)
{
if ($name == "mitch") return "You're awesome";
else return "nice..";
}
echo dostuff("Mitch", "16");
Storing Data from a Database
Obviously you can keep things in variables in a database (though arrays are more efficient).
Configuration uses
Say if you made a commercial script for people to use, often there is a configuration document with a few variables (IE: for connecting to a database etc). If they weren't stored in variables you'd have to type out this information all by yourself one at a time. Bit time consuming..
Storing User input
When using forms, or data from URLs they have to be stored in arrays - (or variables depending on whether register globals are turned on or not). Without them you wouldn't be able to receive information from the user.