Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function tidyHTML($html) {
- // load our document into a DOM object
- $dom = new DOMDocument();
- // we want nice output
- $dom->preserveWhiteSpace = false;
- libxml_use_internal_errors(true);
- $dom->loadHTML($html);
- libxml_use_internal_errors(false);
- $dom->formatOutput = true;
- return($dom->saveHTML());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement