All variables handled in a function are limited only to that function. You can create numberless variables in a function but these variables won't be available to you outside the function except the return variable.
function thisIsMyFunction () {
$var1 = "foo";
$var2 = "bar";
return $var1;
}
echo thisisMyFunction();
Will give you "foo" which you can put in a variable or echo out. If you're looking for a way to load multiple variables for example a config file you could do the following:
config.php
$config["var1"] = "foo";
$config["var2"] = "bar";
index.php
include "config.php";
function myFunction(){
global $config;
echo $config["var1"] . " " . $config["var2"];
}
myFunction();
will result in
foo bar
So in short, something done in the function stays in the function unless some output of that function isn't defined. This is why including with a function will not work.