How to decode html (entity) entities?

6

I have a string that returns me from the bank in the following format:

  

Received by Stake & amp; amp; amp; amp; amp; amp;

I would like to convert it to the format without the accent markings and conversions, thus:

  

Received by project trainees Memory

How should I do it?

    
asked by anonymous 01.05.2016 / 23:38

1 answer

4
To remove entities from the string :

Just use the html_entity_decode

$dec = html_entity_decode( 'Recebido por estagiários do projeto Memória' );

If you need to specify a charset , use the third parameter:

html_entity_decode( 'estagiários', ENT_QUOTES, 'UTF-8' );

See working at IDEONE .


More details in the manual:

  

link


To remove tags from the string :

You have the option to remove the tags using strip_tags

$dec = strip_tags( 'do <b>projeto<b>' );

See working at IDEONE .


More details in the manual:

  

link

    
01.05.2016 / 23:40