Do you use some html templating system?
Now that I have begun to use templates, I never have html code mixed in with my php...ever! It's great having logic separated from presentation and so much easier to maintain. I can't believe that I didn't start this earlier.