title: preg_replace all spans and their content with nothing does not work
body: <p>The preg_replcae in this code is from another answer on this site, and is supposed to replace all spans and their contents with nothing i.e remove all spans and their content. But, why doesn't it work?</p>
  
  <pre><code>$string = &lt;&lt;&lt;STR
  &lt;span&gt;Span 1&lt;/span&gt;
  &lt;div&gt;DIV 1&lt;/div&gt;&lt;div class="text"&gt;DIV 2&lt;/div&gt;
  &lt;span&gt; Span 2 &lt;/span&gt;
  &lt;div class="apache"&gt;DIV 3&lt;/div&gt;
  &lt;span&gt;
  Span 3
  &lt;/span&gt;
  &lt;span&gt;
      Span 4
          &lt;/span&gt;
  
  STR;
  
  $string = preg_replace("/&lt;span[^&gt;]+\&gt;/is","",$string);
  
  echo $string;
  </code></pre>
  
  <p>The end result I was hoping to get is:</p>
  
  <pre><code>&lt;div&gt;DIV 1&lt;/div&gt;&lt;div class="text"&gt;DIV 2&lt;/div&gt;
  &lt;div class="apache"&gt;DIV 3&lt;/div&gt;
  // no spans and their content
  // everything else remains
  </code></pre>