title: REGEX to find and replace IMG elements
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/116403/im-looking-for-a-regular-expression-to-remove-a-given-xhtml-tag-from-a-string">I&#39;m looking for a regular expression to remove a given (x)HTML tag from a string</a>  </p>
  </blockquote>
  
  
  
  <p>I have a long HTML file and I need to remove all the <code>&lt;img /&gt;</code> tags inside it and all the <code>&lt;a&gt;&lt;img /&gt;&lt;/a&gt;</code> anchors.</p>
  
  <p>What I'm thinking of is writing a PHP script that does the job. But each image and link has different number attributes so I don't know how I can do this neatly. Any help would be strongly appreciated.</p>