How to convert html texts (entities) into "normal" texts?

3

In my database are saved rows that are "read" by html, so they 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 the text is going with tags and these characters.

As I TRANSLATE this &nbsp responsável pela integra&ccedil to this:  responsible for integration

Is there any function for this? I'm using php.

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

    
asked by anonymous 18.01.2018 / 19:39

1 answer

3

Use the html_entity_decode() function to convert the html entities to their respective characters.

echo html_entity_decode('responsável');

Output:

responsável
    
18.01.2018 / 19:43