Do you want to send these variables to web pages or are you just saying that you don't know how to call a function from another file? If you mean the first case, which I assume than note that there are three ways to pass a variable to the php program these are using get, post or cookies.
PHP gets executed on the server, which means that once on the client browser its dead. Hence you need to put your variable in a form element:
<FORM ACTION="second.php">
<INPUT TYPE="hidden" VALUE="<?echo $variable ?>">
...
or to pass it to a cookie:
<?
setcookie("variable", $variable);
?>
note that in order for this to work you have to have this at the top of your code.
the second and third programs can access these variables either directly or by calling $HTTP_GET_VARS["variable"], $HTTP_POST_VARS["variable"], $HTTP_COOKIE_VARS["variable"] respectively depending on your php settings.