title: DOMDocument : Find div, get contents and print without div
body: <p>I would like to use DOMDocument or another proposed method to do the following in wordpess:  </p>
  
  <p>I have this html saved in a variable:  </p>
  
  <pre><code>&lt;div id="gallery-3232" class="gallery gallery-3232"&gt;
  &lt;li&gt;&lt;a href=""&gt;&lt;img src="" alt="" /&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=""&gt;&lt;img src="" alt="" /&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=""&gt;&lt;img src="" alt="" /&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=""&gt;&lt;img src="" alt="" /&gt;&lt;/li&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And I would like to end up with a variable containing that:</p>
  
  <pre><code>&lt;li&gt;&lt;a href=""&gt;&lt;img src="" alt="" /&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=""&gt;&lt;img src="" alt="" /&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=""&gt;&lt;img src="" alt="" /&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=""&gt;&lt;img src="" alt="" /&gt;&lt;/li&gt;
  </code></pre>
  
  <p>How can I do this but without javascript. With the use of PHP.</p>
  
  <p>Thabnk you</p>