title: remove a div with class name from a string with php
body: <p>I need to remove a specific div from a string.</p>
  
  <p>My code is:</p>
  
  <pre><code>$varz = "&lt;div class="post-single"&gt;
  &lt;p&gt; Hello all! &lt;/p&gt;
  &lt;div class="ad"&gt;I want to remove this div&lt;/div&gt;
  &lt;/div&gt;";
  
  $varzfinal = preg_replace('/&lt;div class="ad"&gt;.+&lt;\/div&gt;/siU', '', $varz); 
  echo $varzfinal;
  </code></pre>
  
  <p>I need to remove this: <code>&lt;div class="ad"&gt;I want to remove this div&lt;/div&gt;</code></p>
  
  <p>What's the best way to achieve this?</p>