php json_encode()和json_decode()

json_encode()和json_decode()分别是编译和反编译过程

注意json只接受utf-8编码的字符,所以json_encode()的参数必须是utf-8编码,否则会得到空字符或者null

json_decode($arr,true);   json_decode反编译加true就是变成数组,不加true就是Object

 

header("Content-type:text/html;charset=utf-8");

posted @ 2016-11-20 13:05  蚂蚁羽  阅读(344)  评论(0编辑  收藏  举报