PHP json_encode 中文乱码解决方法

 

使用iconv方法把中文编码转换为utf8

$value = iconv('gb2312','utf-8',$value);
json_encode($value);

输出结果正常:{“name”:”中文字符串”}
 
posted @ 2016-04-12 16:18  lifeinearth  阅读(313)  评论(0)    收藏  举报