How to convert html text (entities) to "normal" text?

Asked

Viewed 86 times

3

In my database are saved lines that are "read" by html, so are saved with tags and those characters that do not know the name => &nbsp, &eacute etc...

the problem is that in my application I will use this text to put in a file. only that the text is going with tags and these characters.

how do I translate this &nbsp responsável pela integra&ccedil to this end: integration officer

is there a function for this? I’m using php.

I tried already utf8_encode() and strip_tags () for tags strip_tags () worked.

1 answer

3


Use the function html_entity_decode() to convert the html entities into the repective characters.

echo html_entity_decode('responsável');

Exit:

responsável
  • utf8_decode() also worked in this case, you can tell the difference?

  • @Dobrychtop very curious indeed. I am researching here if you want can create a new question.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.