When displaying HTML code in PHP, if I want to indent tags what would be the best way?
For example,
<?php
$html = '<div><p><span>some text</span></p></div>';
echo htmlspecialchars($html);
?>
will give <div><p><span>some text</span</p></div>
.
Instead, I'd like to show something like,
<div>
<p>
<span>some text</span>
</p>
</div>