I have an xhtml string, and it contains:
<a id="8" />
The number is random each time. It does not have an href attribute, so maybe removing all <a>
without href is an option? I want to remove those parts with PHP, what is my best approach?
I would like to use tidy, but I don't think it has an option to remove those tags.
If that is not possible, I believe preg_replace()
with regex is my second best approach. However, I do not know the regex string to remove those parts.