<?php $beautifier = new DOMDocument('', 'UTF-8'); $beautifier->preserveWhiteSpace = false; $beautifier->formatOutput = true; $beautifier->loadHTML(<<<'HTML' <!DOCTYPE html> <html> <head><title>Hello world</title> <meta charset="UTF-8"> </head><body> <header>test</header> </body> </html> HTML , LIBXML_NOERROR); echo $beautifier->saveHTML();
You have javascript disabled. You will not be able to edit any code.