PHP html decoding help - converting: A 'quote' is <b>bold</b>
I need to convert a string like this: A 'quote' is <b>bold</b> into: A 'quote' is <b>bold</b> html_entity_decode() did not work. Make sure you use the right quote_style: html_entity_decode('A 'quote' is <b>bold</b>', ENT_QUOTES); ENT_QUOTES Will convert both double and single quotes. ( PHP Manual: html_entity_decode ) mb_convert_encoding($string, "UTF-8", "HTML-ENTITIES"); You can replace "UTF-8" with whatever encoding you need (though depending on the encoding you choose, certain characters may not be representable). 来源: https://stackoverflow.com/questions/3574609/php-html-decoding-help