I have a long string of HTML that contains
<p>
<img>
<span>
and a bunch of other tags.
Is there anyway of extracting ONLY the text within the tags from this string?
If you want to extract all text within any tags, the simple way is to strip the tags: strip_tags()
If you want to remove specific tags, maybe this SO questions helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With