html_entity_decode第一次无法正常工作

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 &gt;&lt;&nbsp;, 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 &gt;&lt;&nbsp;, thank you.

Only doing another html_entity_decode would give me the correct result:

html_entity_decode(strip_tags(html_entity_decode($str)));
  • The string was taken directly from the post variable of CKEditor.

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.