title: PHP replace opening div or span by class
body: <p>Using something like PHP's str_replace, preg_replace, or something else, I need to find all opening div or spans in a very long string that contain a certain class and replace the entire opening div or span with some other text.  For example:</p>
  
  <p>If I have the following div in my string:</p>
  
  <pre><code>...lots of text &lt;div style="display: inline;" class="MyClass"&gt;zoom&lt;/div&gt; other text...
  </code></pre>
  
  <p>I want to find that div by the class name in the entire string and replace that div with "blah blah blah."  I can find the closing tag easily so I'm not worried about that one.</p>
  
  <p>Thank you!</p>