I\'m using the DOM extension in PHP to build some HTML documents, and I want the output to be formatted nicely (with new lines and indentation) so that it\'s readable, howev
You can use the code for the hl_tidy function of the htmLawed library.
// indent using one tab per indent, with all HTML being within an imaginary div $out = hl_tidy($in, 't', 'div')