Everybody has a different approach. I use the Smarty template engine (http://www.phpinsider.com) to completely separate my code from my presentation. I use a series of classes specifically related to their functions to keep the code easy to read.
For example, I have a "database" class which handles all the database functions. So on any page that I need database connectivity, I just do:
$db = new Database(args here);
The args are all pre-defined in a global config file.
Then I have a series of objects related to the various function the site is performing. For example, I have an "articles" section. So what I do for a page is start it with a template object, connect to the database, fetch the article they're looking for, then print it to the screen. This is a simplified example, but this is how most of my pages look.
Notice the "new Article()" statement - what I'm passing there is a reference to the $table array, which contains all the various table names the site uses, and a reference to the previously created $db object, so the articles object can access the database).
// Includes
include('classes/template.php');
include('classes/database.php');
include('classes/article.php');
// Objects
$tpl = new Template();
$db = new Database($host, $user, $password, $database);
$art = new Article(&$table, &$db);
// Get the article
// This actually returns an associative array that holds everything about that article (article name, summary, author, text, etc.)
$article = $art->getArticle($artID);
// Assign the article to the template
$tpl->assign('Article', $article);
// Fetch the template specific to the article and place it into the main site template
$tpl->assign('Content', $tpl->fetch('article.tpl'));
// Print the page
$tpl->display('main.tpl');
Some might complain that having so many objects and includes can lead to performance issues. That may or may not be true... It certainly helps with keeping my code clean and easy to program. I have the whole thing in "compiled" templates thanks to smarty, plus the content gets cached, so under all my benchmarks, cached pages are returned in two-one-hundreths of a second. After the cache expires, it can take anywhere from a tenth of a second to a half of a second to regenerate the cache (depending on the complexity of the page and the efficiency of my queries, some of which I need to re-examine).