I have a string in variable $html
that contains minified HTMl code, all in one line, like:
$html = '<body><div><p>hello</p><div></body>';
How do I beautify/pretty print the HTML so that my variable becomes like:
$html = '<body>
<div>
<p>hello</p>
<div>
</body>';
I know the tidy extension is a possibility, but how can this be done without an extension.
EDIT: PLEASE read the question. I am not asking how to beautify HTML code via some external site. I am asking how to do it in PHP, specifically targeting the string variable.