Indent PHP Echoes With HTML
Posted: Mon Jul 28, 2008 10:19 am
When I view the source code for my PHP, I've noticed that the PHP doesn't indent in the same way as my HTML. What I mean by that is I always indent my HTML with a tab, so that it's easier to see where everything is, and it just looks a lot neater. However, if I use PHP code in the middle of my HTML, the PHP code is not in-line with my HTML. In other words, the HTML generated by the PHP (as PHP isn't displayed in the source code) is always aligned left, and it looks very messy. I've discovered how to use line breaks in the PHP code, so that I don't have to scroll right to view all the code, but now I'm having a bit of trouble getting the PHP to indent with my HTML, so that everything looks nice and tidy. Does anyone have any suggestions? Would it be easier to not bother indenting the HTML, so that everything is aligned to the left?