Json数组基础知识
1
2
3
4 |
{ "姓名":"大憨", "年龄":24 } |
1
2
3
4
5
6
7 |
{ "学生": [ {"姓名":"小明","年龄":23}, {"姓名":"大憨","年龄":24} ] } |
和XML的比较
实例比较
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 |
<? xmlversion = "1.0" encoding = "utf-8" ?> < country > < name >中国</ name > < province > < name >黑龙江</ name > < cities > < city >哈尔滨</ city > < city >大庆</ city > </ cities > </ province > < province > < name >广东</ name > < cities > < city >广州</ city > < city >深圳</ city > < city >珠海</ city > </ cities > </ province > < province > < name >台湾</ name > < cities > < city >台北</ city > < city >高雄</ city > </ cities > </ province > < province > < name >新疆</ name > < cities > < city >乌鲁木齐</ city > </ cities > </ province > </ country > |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 |
{ "name":"中国", "province":[ { "name":"黑龙江", "cities":{ "city":["哈尔滨","大庆"] } }, { "name":"广东", "cities":{ "city":["广州","深圳","珠海"] } }, { "name":"台湾", "cities":{ "city":["台北","高雄"] } }, { "name":"新疆", "cities":{ "city":["乌鲁木齐"] } } ] } |
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。