to use a function it has to be defined
so in whatever file the function is
it has to be included in the script where function will be used
in your case the file B would have to do an include('file A')
one good way is to keep All functions in one or several separate php-files
has only functions, definitions, but does nothing else
many softwares have such separate file
/includes/common_functions.php
there are even softwares that has one include file for each function, or type of functions
/includes/display_functions.php
/includes/database_functions.php
/includes/user_functions.php