---------------------------------------------------------------------------------------------------- header ('content-type:text/html;charset=utf-8' ); $a = '中文' ; echo json_encode( $a ); // 5.3版本以前,无参数情况输出 "\u4e2d\u6587" echo
----------------------------------------------------------------------------------------------------
<span>header</span>('content-type:text/html;charset=utf-8'<span>); </span><span>$a</span> = '中文'<span>; </span><span>echo</span> json_encode(<span>$a</span>);<span>//</span><span>5.3版本以前,无参数情况输出 "\u4e2d\u6587"</span> <span>echo</span> json_encode(<span>$a</span>, JSON_UNESCAPED_UNICODE); <span>//</span><span> "中文"</span>
Link: http://www.cnblogs.com/farwish/p/3847845.html