I'm really struggling to get my head around DOMDocument parsing.
I'm trying to solve the following problem.
Given the following HTML
<h1>Title</h1>
<p>Some Content</p>
<p>Some More Content</p>
<p>Other Content</p>
<p>Last Bit of Content</p>
I want to add in a div with something else after the second paragraph tag. Essentially the outcome needs to be something like the following
<h1>Title</h1>
<p>Some Content</p>
<p>Some More Content</p>
<div>Something different</div> <!-- new tag -->
<p>Other Content</p>
<p>Last Bit of Content</p>
Having looked at a few post on here I'm now getting bored of scratching my head now.