PHP str_replace regex to remove link with tags
How would I use str_replace to remove this following link and tags all together.
Tags needs to be rem开发者_如何转开发oved, ignoring link and link text all together:
<p><a href=""></a></p>
Also, this one:
<p><em><a href=""></a></em></p>
Note, I don't need to grab any content from this tags, simply remove them from my data. Thanks.
Use DOMDocument or some substitute.
Also, please read the accepted answer to this question.
Edit
Also, as Ed Marty pointed out there is the strip_tags and I guess I'll point to filter_var.
Use the strip_tags function instead.
精彩评论