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

后端 未结 2 1105
天涯浪人
天涯浪人 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:39

    Make sure you use the right quote_style:

    html_entity_decode('A 'quote' is bold', ENT_QUOTES);

    ENT_QUOTES Will convert both double and single quotes. (PHP Manual: html_entity_decode)

提交回复
热议问题