How to use PHP's DOM extension loadHTML
<p>It was suggested to me that in order to close some "dangling" HTML tags, I should use PHP's DOM extension and loadHTML.</p>

<p>I've been trying for a while, searching for tutorials, reading <a href="http://www.php.net/dom" rel="nofollow">this page</a>, trying various things, but can't seem to figure out how to use it to accomplish what I want.</p>

<p>I have this string: <code>&lt;div&gt;&lt;p&gt;The quick brown &lt;a href=""&gt;fox jumps...</code></p>

<p>I need to write a function which closes the opened HTML tags.</p>

<p>Just looking for a starting point here.  I can usually figure things out pretty quick.</p>
