I'm a self taught PHP guy and I've worked on many small projects where I have created a "functions.php" file to store common functions that I will be doing on every page, such as a DB connection. Then at the top of the page I just include the functions file and call the function. These have always been small projects.
Now I'm working on a "BIG" project where things like structure and efficiency really matter...and my deficiency in understanding these areas is shining through.
So my question is this...lets say I have a lot of basic functions for things like connecting to a DB, testing a cookie against something stored in the DB and so forth...things I will need to do on almost every page. Should these be put in a functions file, or should these functions be put in a class. Which and why?