Forum Moderators: coopster
It feels like I'm creating too many php files to make my site work...each one having a specific script or a single function on it, and I'm wondering if there's a way to put a lot of PHP functions/classes in one file and then call the specific scripts as needed from the php commands on other pages?
I use 'require' and 'include' here and there for saved snippets of code, but can I call specific snippets from a page with a lot of them on it? (sort of like the 'url_link#name.html' in HTML) or maybe like a "php stylesheet"...
Not sure I've been clear enough, but maybe some of you "PHP elders" know what I'm asking...
thanks in advance.
mc
In summary, I think it is a good idea to separate common function into different includes but you should not have to include more than 3 or 4 files. On the other hand, if you find that you are including all 3 or 4 of the files on pretty much every page you are better off putting them all in one file and just including that.
I hope this proves useful.