Without using include_once or any include/require how can I reference functions declared in other php files in the current directory? Just like we use fopen.
Including contents of php files which contain code not in functions can be a clutter. It’d be better if function usage is linked automatically to its definition.
I’ve also checked How to include() all PHP files from a directory? which requires some code to do it.
I’m not able to find answer of this anywhere in internet may be because of too common search terms for this problem.
You can use glob to traverse the directory and then include them:
As you are referencing functions in other files, you cannot use the autoloader because the autoloader operates on classes. Autoloading classes would be a much better solution.