How to display special characters in PHP

前端 未结 9 1315
野的像风
野的像风 2020-11-30 12:24

I\'ve seen this asked several times, but not with a good resolution. I have the following string:

$string = \"

Résumé

\";

9条回答
  •  旧巷少年郎
    2020-11-30 13:10

    So I try htmlspecialchars() or htmlentities() which outputs

    Résumé

    and the browser renders

    Résumé

    .

    If you've got it working where it displays Résumé with

    tags around it, then just don't convert the paragraph, only your string. Then the paragraph will be rendered as HTML and your string will be displayed within.

提交回复
热议问题