I was wondering whether there is class or something similar which I can include into my PHP pages to beautify the HTML output.
Such as putting new lines in after tags and correctly indenting so that my source code isn’t only one line, I know that to the browser it doesn’t matter but I wish to do this.
I have heard of http://www.php.net/manual/en/book.tidy.php but am not clear on what it does and how to implement it, i.e. I don’t understand what the manual says about it.
The
Tidyextension is the way to go.If you don’t understand the documentation (OK, admittedly it’s not very thorough), then the first results on Google for
php tidy tutorialslook very promising: