I would like to strip the tags out of my wordpress feed, but keep the paragraphs.
strip_tags($content, '<p>' );
This works fine but I do not want to keep the paragraphs that deals with image captions... they look like this:
<p class="wp-caption-text">blah blah blah</p>
So, how do I strip tags that hold, let's say, class attributes?
All help much appreciated.
Edit: This wasn't actually the solution to what the OP wanted, however answers the question that was asked.
You can't do this with strip_tags directly unfortunately.
You could use DOMDocument, though, then strip_tags after: