Page 1 of 1

Question about functions: where to put them?

Posted: Thu Feb 10, 2005 1:54 am
by mhenke
I would like to know what is the best/fastest way to deal with my functions:

Do I put them all in one file, and include the file with each page, or do I split them up, and include only the ones that are needed for that page?

I would appreciate feedback, couldn't find anything about this.

Posted: Thu Feb 10, 2005 2:00 am
by feyd
oft used functions should generally be stored together. Not so oft, in seperate, potentially page related, scripts.. or directly in the file they are used (if only called from a single script)

that's the general route I try to take. Try to avoid including too many files, as each requires php to load and parse that file, along with the harddrive seek time..