Great article, one note though, there's a better, cleaner (in my opinion) way to embed PHP into HTML, and that is using keywords in replace of brackets, such as:
PHP Code:
<?php if ($condition == 'value') : ?>
<input type=”text” name=”<?php echo $name; ?>” />
<?php endif; ?>
Each to their own, I just prefer this way and thought it deserved a mention.
Finally, I have one more suggestion :)
1) Keep functions short and concise, with descriptive function names. This improves code clarity (cohesiveness), there's nothing worse than looking at a function that is responsible for 10 different little tasks, break that function up into smaller, more understandable functions.
Of course we're treading onto refactoring here, but imo that's an important part of clean code.