You're asking about how to route requests to the appropriate function. This is a big topic, and it's usually a good idea to use an off the shelf routing library. You could search online for php routing library and pick one that has a good reputation and you find convenient to work with.
As for linking two PHP scripts together, so that you can define functions in one and call them in the other, the standard way is to use autoloading and composer. If you install and use composer, and combine all your functions into a PHP class, PHP will be able to detect when it needs to load the file that defines the class, and load it automatically. See instructions at https://medium.com/tech-tajawal/php-composer-the-autoloader-d676a2f103aa .
If for any reason you can't use autoloading, it's usually better to use
require_once instead of
include. This will stop the script immediately if it can't load the file it needs, which should make it easier to spot the problem. It will also keep track of whether it's loaded the script already, and not load it again. It's very common in a more complex project to end up requiring one file for multiple reasons, but if it just defines classes and functions there's no need to actually load it more than once.