json_encode won't encode French characters

后端 未结 5 1697
感动是毒
感动是毒 2020-12-06 15:22

I\'m trying to work with French characters. For whatever reason, PHP won\'t output them correctly unless I force the ISO-8859-1 character set (which I really don\'t

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-06 15:58

    I have run into the same issue, but I would suggest:

    $array = htmlentities($array);
    $json = json_encode($array);
    

提交回复
热议问题