Home > Backend Development > PHP Tutorial > 持续提问:die(json_encode(. 没返回

持续提问:die(json_encode(. 没返回

WBOY
Release: 2016-06-13 12:08:05
Original
940 people have browsed it

继续提问:die(json_encode(... 没返回
继续这个帖子的提问:http://bbs.csdn.net/topics/390901967
之前我结错帖了,以为已经解决了问题,实际上没解决。
所以请高手们继续指导指导吧!十分感谢!

主要问题回顾:
旧帖子 24 楼 xuzuning 的回复:
tip 函数应写成这样

<br />function tip($code, $msg) {<br />    $arr['code'] = iconv('GB2312', 'UTF-8', $code);<br />    $arr['msg'] = iconv('GB2312', 'UTF-8', $msg);     <br />    die(json_encode($arr));<br />}<br />
Copy after login


谢谢!这样子确实有返回了,但是有个问题:
<br />$(".tscg4").html(data.msg);  <br />
Copy after login

中data.msg的值变成浜ゆ
怎么变回:交易密码不能与登录密码一样! 呢?
请继续指教,十分感谢!
------解决思路----------------------
alert(data.msg);
截个图
------解决思路----------------------
如果你的程序文件是 utf-8 的,那么为什么要 $arr['msg'] = iconv('GB2312', 'UTF-8', $msg); ?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template