Function to remove specified html tags from string
Alright!  You made me do it.  I'm posting an answer :)

Parsing arbitrary HTML via regular expressions is nearly impossible.  If you were using this on HTML code that you control yourself, it is certainly possible, because you can make sure that all of the edge cases never happen.  However, if you are going to set this loose on arbitrary HTML from the internet, you will find that it fails to work in a number of cases.  Your use case is a little simpler because you are just trying to remove the tags themselves (and not their contents), but even still it can be surprisingly tricky.  You probably need a straight-up HTML parser.  There are a bajillion of them for PHP.  Other than the easy ones I mentioned in my initial comment, here are some more variations that I think will completely sink your current code.  I have actually seen this first one in use on the intertubes: it is technically valid HTML:

&lt;a href="#" class="tooltip" data-contents="&lt;br&gt;Hi&lt;br&gt;"&gt;Hover me&lt;/a&gt;


Another good one: your new regular expression allows for more flexibility in the tag contents at the expense of tag specificity.  In other words, I'm pretty sure that if you use your script to try to remove &lt;b&gt; tags, you will also end up removing &lt;br&gt; tags.

These, and the examples in my initial comment, are some exceptions I came up with just off the top of my head.  In contrast, the internet cumulatively has a bajillion hours experience writing hard-to-parse HTML strings.  Sure, your code might even work 90% of the time, but if you stick with regular expressions it will definitely fail on a regular basis.  It's up to you to decide if the failure rate is low enough.

Especially important: If you are trying to use this as a security tool then definitely don't.  It is nowhere near reliable enough.  Sorry.  It's not that your algorithm isn't well thought out.  It's just that HTML is a full dialect that needs an actual parser: regular expressions just aren't meant for this kind of thing.  It's like trying to build an actual house out of toothpicks.

See this similar question/answer:

Regex to remove inline javascript from string