By functions file I’m referring to a file that is called for in each PHP page and contains functions. I noticed another question asking about function files and it reminded me that my PHP website did not use any function file. So I’m just wondering if function files are recommended for sites.
Share
If the concept of functions is not familiar to you, they’re essentially re-usable blocks of code. If you have a bunch of functions you created, you probably want to re-use them here and there throughout your site. So what you do is collect them in one central file (or several grouped by “topic”) and
includethem in every page you need them.It’s all to make code re-usable.
I.e. if you find yourself writing basically the same code again and again with only slight variations, put that code into a function and put that function into some central, re-usable file.