[thelist] personal PHP preference inquiry

Rick den Haan rick.denhaan at gmail.com
Sat Apr 23 18:02:25 CDT 2005


Hi List,

I was wondering how all you PHP programmers out there work with custom
functions. Do you like to:

a) put all necessary functions in the page itself;
b) put all functions in one seperate file, and include this big file
into the page;
c) put each function in its own file, and include when needed;
d) else?

Myself, I used to go for option B, where I have one big functions.php
file that holds all functions used throughout the entire website and
include that into every page, but I recently switched to C, since most
of my sites use the same structure for e.g. guestbooks, shopping carts
and mailing lists and the code is basically the same. I find it quite
useful to have portable functions I can just copy to a different
website, include it and have it up and running in no time.

So what are your preferences?

Rick.


More information about the thelist mailing list