I have a .txt file. Using the following code I read it:
while (!feof($handle)) {
yield trim(utf8_encode(fgets($handle)));
}
Now from the retrieved string I want to remove not only the HTML tags but also the HTML content inside. Found many solutions to remove the tags but not both - tags + content.
Sample string - Hey my name is <b>John</b>. I am a <i>coder</i>!
Required output string - Hey my name is . I am a !
How can I achieve this?