In a new post to the SitePoint PHP Blog today, Ian Muir shows you how to keep thing separated using the HTML Template IT extension. It helps prevent application functionality and logic from seeping its way into your output.
One of the more challenging things I've run into while doing PHP development is effectively separating presentation from program logic. In many projects, I felt I was doing a great job until I had to do a markup change and jump through a lot hurdles to make it happen. In my recent projects, I've starting using the HTML Template IT extension in PEAR, and its made things a lot easier.
By way of example, he gives code blocks - one showing an example template and the other how to populate it with your own data. You can get more information on the extension from it's PEAR page.