I have a string of html that I want to decode and strip off html tag before sending them out through email.
Here's the string :
<p>This is a test <em>please </em><strong>ignore </strong>it >< , thank you.</p>
After decode and strip off the html tags using html_entity_decode and strip_tags I still get some html entities left.
strip_tags(html_entity_decode($str));
//got result as This is a test please ignore it >< , thank you.
Only doing another html_entity_decode would give me the correct result:
html_entity_decode(strip_tags(html_entity_decode($str)));
I don't understand why the first html_entity_decode doesn't do the trick and need another html_entity_decode. Could some please explain this to me?
Thanks in advance.