Home > Backend Development > PHP Tutorial > 关于Thinkphp ajaxReturn解决方法

关于Thinkphp ajaxReturn解决方法

WBOY
Release: 2016-06-13 12:10:08
Original
1431 people have browsed it

关于Thinkphp ajaxReturn
  返回的json数据是
[{"univ_id":"10001","univ_name":"\u5317\u4eac\u5927\u5b66","univ_photo":"10001.jpg","univ_website":"\u8fdb\u5165","univ_introduce":"\r\n\u5317\u4eac\u5927\u5b66\u521b\u529e"}]

u5317\u4eac\u5927\u5b66\u521b\u529e这样的字符应该都是汉字。。但是没显示出来 请问有什么办法解决?

不知道我描述清楚没 先说一下我百度之后做了的一些处理
urlencode   url编码 。
$arr = array(
('id') => urlencode($univ_id), 
('name') => urlencode($univ_name),
('introduce') => urlencode($univ_introduce)
);
echo urldecode(json_encode($arr));   确实能转 。可惜我想用ajaxretun  。。
数据量实在太大如果用这种方法 我会吐血的。。




------解决思路----------------------
那是 unicode  中文的 html 实体表示
不必管他,到了浏览器就显示出来了

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