You can declare it as "global" within the function itself. However, this can have some potential for hard-to-find bugs as your code evolves, so I generally recommend passing any variables as function parameters. If you need any changes the function makes to that variable to take effect outside of the function, then pass it by reference (a "&" before the variable name in the function's parameter list).
$a = 0;
function one()
{
global $a;
$a = 1;
}
one();
echo $a; // outputs "1"
function two(&$var) // passed by reference
{
$var = 2;
}
two($a);
echo $a; // outputs "2"
function three($var)
{
$var = 3; // this is local only to this function
}
three($a);
echo $a; // still outputs "2"