title: Find a div with certain class and add some HTML after and before it (with PHP!)
body: <p>I have the following problem - How to find a div with class "test" and add "<code>&lt;/div&gt;</code>" <strong>before</strong> it and "<code>&lt;div class="sth"&gt;</code>" <strong>after</strong> it.
  More detail example:</p>
  
  <pre><code>&lt;!-- The original code --&gt;
  &lt;div class="parent"&gt;
     ...here we can have some more content...
     &lt;div class="test"&gt;&lt;/div&gt;
  &lt;/div&gt;
  
  &lt;!-- The thing that I want to achieve --&gt;
  &lt;div class="parent"&gt;
  ...here we can have some more content...
  &lt;/div&gt;
  
  &lt;div class="test"&gt;&lt;/div&gt;
  
  &lt;div class="sth"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I tried with javascript/jQuery but with no success, because it is generated in DOM.
  So I decided to do it with something that will work on it before to show the content.</p>
  
  <p>Any ideas how to accomplishe that?</p>
  
  <p>(The content will be generated by Wordpress posts, if that would help you...)</p>
  
  <p>p.s. Sorry for my bad English</p>