title: simplehtmldom how can i extract between two elements
body: <p>I'm using Simple HTML DOM parser to do this. Basically, I'm trying to extract all <code>&lt;p&gt;</code> tags between <code>&lt;table class="first"&gt;</code> and <code>&lt;div class="second"&gt;</code>:</p>
  
  <pre><code>&lt;div id="main&gt;
     &lt;table class="first"&gt;
     &lt;p&gt;
     &lt;p&gt;
     &lt;p&gt;
     &lt;div class="second"&gt;
     &lt;p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>In this case, there are 3 <code>&lt;p&gt;</code>s, but sometimes it might just be two or even one. Any <code>&lt;p&gt;</code> can have id or class. Can someone point me in the right direction?</p>