I use xitami as a web server. It makes allowances in the config file to specify an 'include' directory. With this in mind I can put at the top of my php scripts:
require("library1.php");
library1.php is where I store all of my functions that I use throught my program.
library1.php is in my 'include' directory (php will look in the include path to find any file that you 'require' or 'include' in your scripts).
'requiring' my library file (which contains all my functions)in my script makes it as if the entire library file were a part of that very script it was 'required' in. Accordingly, that script has access to all of the functions in library1.php. From there all you have to do is call the script, ie scriptname();, just as if the function were actually on the script itself.
Hope that long winded exp. helped 🙂