Well unless you are using an old version of Internet Explorer the indentation of the markup shouldn’t present a problem. If it is just hard to read when viewing source, you could always hook into HTML Tidy or something like that.
It is impossible and actually not needed. Actually I would prefer to remove any indentation for several reasons Use a browser built-in functionality to view DOM tree (Opera, FF and Chrome have some nice stuff to do that).
Sure, PHP code must have indentation, but not the final HTML code. It’s almost impossible to control it when you have lots of widgets and PHP code mixed with HTML. And people who think it’s not good probably don’t understand that, so why should you care about their opinion? Take a look at the Google.com source code. Perfect HTML!
I would love to hear about a solution about this. But as said before: Its not possible by the way how the PHP interpreter works. At least i do not know a solution for this.
One might use ASP.NET technology to achieve that goal.