You can import variable sinto your function using the 'global' command:
function this()
{
global $that, $whatever;
echo $that;
};
Note: this is bad practice, because you quickly forget which functions use which variables.
You'll soon find yourself wondering why a function doesn't work, and it turns out you forgot to import a var using the 'global' command, or the global command imported the wrong variable.
Also, when you import a var using the 'global' command, you effectively get a reference to the var. So if you change the value of the var inside the function, it will also change outside the function.
That means you can't use a 'globalled' var as a counter, or it will seriously mess up the rest of your script.
Sending the vars to the function as arguments is more work, but it's worth the effort.