too many php files
Posted: Thu Nov 10, 2005 5:10 pm
I've been learning PHP as I go with a lot of trial and error and plenty or reading, too - and it's been working great, but I think I've missed something along the way.
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
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