$every_day = json_encode($day_clues['every_day']);转义后的$every_day在js上是这样的:["12u670818u65e5","12u670819u65e5","12u670820u65e5","12u670821u65e5","12u670822u65e5","12u670823u65e5","12u670824u65e5","12u670825u65e5","12u670826u65e5","12u670827u65e5"];js中是怎么转义回来的,加上eval()吗,试过了没用啊
2 回答
沧海一幻觉
TA贡献1824条经验 获得超5个赞
php 输出JSON的时候 声明header 头
header("Content-Type: application/json; charset=utf-8");
正常是不用再转义的
喵喔喔
TA贡献1735条经验 获得超5个赞
json_encode加个参数
json_encode([],JSON_UNESCAPED_UNICODE);
js解析json
JSON.parse('["12u670818u65e5","12u670819u65e5","12u670820u65e5","12u670821u65e5","12u670822u65e5","12u670823u65e5","12u670824u65e5","12u670825u65e5","12u670826u65e5","12u670827u65e5"]');
添加回答
举报
0/150
提交
取消