JSON_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:26:11
Original
1004 people have browsed it



请问 怎么将图中数据写成json形式。我的思路是学生在最外面是一个集合,每个学生对应所有公司。这么想有问题吗?
下面是我的json 但存在问题。如何引用对象gongsi? 或者怎么去修改 谢谢
[
{
"Student" : 
[
{
"email" : "ab123",
"sid" : 123456789,
"city" : "Leicester",
"postcode" : "LE17HA",
"gongsi"
},
{
"email" : "zy987",
"sid": 987654321, 
"city": "Leicester", 
"postcode": "LE 17HA", 
"gongsi"
}
}
]
var gongsi=

{
"Company":
 [
{
"name": "JADU", 
"city": "Leicester", 
"postcode": 
"LE19 1RG"
}, 
{
"name": "IBM", 
"city": "Leicester", 
"postcode": "LE 17HA"
}]
}


回复讨论(解决方案)

"gongsi":{
"Company":
 [
{
"name": "JADU", 
"city": "Leicester", 
"postcode": 
"LE19 1RG"
}, 
{
"name": "IBM", 
"city": "Leicester", 
"postcode": "LE 17HA"
}]
}
不就可以了吗?或者使用变量

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!