Home  >  Article  >  php教程  >  [PHP]json

[PHP]json

WBOY
WBOYOriginal
2016-06-06 19:49:40765browse

---------------------------------------------------------------------------------------------------- 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>

 

[PHP]json

 

Link: http://www.cnblogs.com/farwish/p/3847845.html

Statement:
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