PHP html decoding help - converting: A 'quote' is bold

后端 未结 2 1104
天涯浪人
天涯浪人 2020-12-06 04:32

I need to convert a string like this:

A 'quote' is bold

into:

A \'quote\' is 

        
2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-06 04:57

    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).

提交回复
热议问题