Generally this is frowned upon. Especially frowned upon if you're background is in computer science and/or object oriented programming. Short answer: you can, but not recommended.
Longer answer:
Attempting to use global variables in this manner is sloppy coding. By declaring the variables global, any function can modify them including functions you may not intend or wish to modify them with. Basically you're unintentially introducing bugs into your code. From a maintenance standpoint (assuming there's no bugs), every time you update your code, you'll mentally have to juggle all the global variables regardless of where you're updating the code at in the file. And if someone else was to update your code, it would be very difficult for them to keep track of all the global variables floating around.
So, the recommended approach is to keep the variables local. It sounds like more work, but if you think about it, it should save you time when it comes to troubleshooting and fixing/updating your code.
An example:
function startHere()
{
// let's say the code starts here
// here's some generic variables - they're local
$sVar1 = 'My string';
$aVar2 = array();
$nVar3 = 10;
$nVar3 = addFive($nVar3); // add 5 to variable passed in and return new value
$aVar2 = addRow($aVar2); // add a row to the array
$sVar1 = addString($sVar1); // append a string
passByRefernce(&$sVar1, &$aVar2, $nVar3); // pass vars by reference
} // end function startHere()
So you probably see the pattern with the first 3 functions. They all pass a COPY of the variable to the function and the function returns a value back and we reassign that value to the variable (although you could assign the value to a new variable leaving the original intact which can be handy at times).
function addFive($num)
{
// do not have access to any vars except $num
return $num + 5;
} // end addFive($num)
function addRow($aArray)
{
// $aArray is all we know about
$aArray[] = "Yo";
return $aArray;
} // end function addRow($aArray)
function addString($sString)
{
return $sString . ' adding to the string.';
} // end function addString($sString)
Now the fun one is passByRefernce(&$sVar1, &aVar2, $nVar3);. Here the '&' means pass by reference. This means the variable's memory address is passed instead of its contents. So what? Well, it allows (or if you want to think of it, "gives permission") to the called function to make changes directly to that variable. This is handy when need to have a function update several variables at the same time.
Now here's something to think about: If you NEED a function to modify several variables at the same time, you probably have that function doing too much work. You should break it down into simpler functions so that each function updates one variable and so they just need to return one value.
But for example, here's a pass by reference function:
function passByReference(&$sVar1, &$aVar2, $nVar3)
{
// this function has direct access to:
// $sVar1 and $aVar2
// this function has a COPY of:
// $nVar3 (changes to this var will not leave this function
$sVar1 = 'New string';
$aVar2[] = 'Add a string to this array';
$nVar3 += 20;
// at this point point we're done
// all the changes except for $nVar3 will be reflected in the parent function. Since $nVar3 was not passed by reference, its parent value was never updated (this function was working with a COPY of $nVar3 but not the original like the other variables)
} // end function passByReference(&$sVar1, &$aVar2, $nVar3)
So that's my crash course on call functions and return variable data. If you keep in mind:
keep it simple as in return function values instead of using pass by reference
pass by reference is an option if you really need it
global variables are evil (except super globals like $GET and $POST for example are defined by PHP to help you out)