php json_encode转义后的中文怎么在js中转义回来

$every_day = json_encode($day_clues['every_day']);
转义后的$every_day在js上是这样的:

["12u670818u65e5","12u670819u65e5","12u670820u65e5","12u670821u65e5","12u670822u65e5","12u670823u65e5","12u670824u65e5","12u670825u65e5","12u670826u65e5","12u670827u65e5"];
js中是怎么转义回来的,加上eval()吗,试过了没用啊


尚方宝剑之说
浏览 1114回答 2
2回答

沧海一幻觉

php 输出JSON的时候 声明header 头header("Content-Type: application/json; charset=utf-8");正常是不用再转义的

喵喔喔

json_encode加个参数json_encode([],JSON_UNESCAPED_UNICODE);js解析jsonJSON.parse('["12u670818u65e5","12u670819u65e5","12u670820u65e5","12u670821u65e5","12u670822u65e5","12u670823u65e5","12u670824u65e5","12u670825u65e5","12u670826u65e5","12u670827u65e5"]');
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript