首页 > 编程 > PHP > 正文

[PHP]json_encode增加options参数后支持中文

2019-11-15 01:41:21
字体:
来源:转载
供稿:网友
[php]json_encode增加options参数后支持中文

----------------------------------------------------------------------------------------------------

header('content-type:text/html;charset=utf-8');$a = '中文';echo json_encode($a);//5.3版本以前,无参数情况输出 "/u4e2d/u6587"echo json_encode($a, JSON_UNESCAPED_UNICODE); // "中文"

Link: http://www.VEVb.com/farwish/p/3847845.html


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表