How to get json_encode() to work with ISO-8859-1 (åäö)

前端 未结 8 897
礼貌的吻别
礼貌的吻别 2021-01-11 15:58

json_encode() wont work for me when I\'m using åäö. Why? And how can I get it to work?

The php:

echo json_encode($arr);
         


        
8条回答
  •  心在旅途
    2021-01-11 16:58

    It says in the json_encode() documentation:

    This function only works with UTF-8 encoded data.

    You should convert it to utf-8 with iconv or mbstring first.

提交回复
热议问题