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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.