PHP Tricks and Best Practices?
ericwaller: Something that took me a number of projects and maintenance type work to realize is to use "helper" functions wherever possible.For example, a profile link:    <a href="/user/profile/<?=$user->id?>"><?=$user->name?></a>

Write a simple function:    function user_profile_link ($user) {
        return '<a href="/user/profile/$user->profile">$user->name</a>';
    }

And use it:    <?=user_profile_link($user)?>

I used to think the extra code upfront wasn't worth it, but after dealing with a bunch of 300+ line templates for a while, I can tell you that it definitely is.Also, you can see a use of string interpolation (a common use case for sprintf), ie "count is: $count"