php - html_entity_decode not working for the first time -


i have string of html want decode , strip off html tag before sending them out through email.

here's string :

<p>this test <em>please </em><strong>ignore </strong>it &gt;&lt;&nbsp;, thank you.</p> 

after decode , strip off html tags using html_entity_decode , strip_tags still html entities left.

strip_tags(html_entity_decode($str)); //got result test please ignore &gt;&lt;&nbsp;, thank you. 

only doing html_entity_decode give me correct result:

html_entity_decode(strip_tags(html_entity_decode($str))); 
  • the string taken directly post variable of ckeditor.

i don't understand why first html_entity_decode doesn't trick , need html_entity_decode. please explain me?

thanks in advance.


Comments

Popular posts from this blog

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -