0

I have this string which contains HTML code:

....
....
<span class="sss">some word</span>
....
....

How can I take only text from this line, in my case some word. I tried to do this using the substr and strpos functions. But, I have some problem.

  • Closing </span> tags were encountered in the string before
  • I do not know how long the text will be (in my case some word)

P.S That text not only non-html portion of the string value

John Smith
  • 11
  • 1

0 Answers0