Home > Web Front-end > JS Tutorial > json definition_json

json definition_json

WBOY
Release: 2016-05-16 19:03:51
Original
1209 people have browsed it

We know how to write
xml:



> http://www.jialing.net


John


john@gmail .com
 http://www.john.com


Peggy

 
peggy@gmail.com
 http://www.peggy.com
 

How to write json?
JSON:
[
{
name: "Michael",
email: "17bity@gmail.com",
Homepage: "http://www.jialing.net"
},
{
name: "John",
email: "john@gmail.com",
homepage: "http://www.jobn.com"
},
{
name:"Peggy",
email:"peggy@gmail.com",
homepage:"http: //www.peggy.com"
}
]

It can be clearly seen:
JSON format:
1, object:
{name:" Peggy",email:"peggy@gmail.com",homepage:"http://www.peggy.com"}
{ attribute : value , attribute : value , attribute : value }
2, the array is A collection of ordered values. An array starts with "[" and ends with "]", and the values ​​are separated by ",".
[
{name:"Peggy",email:"peggy@gmail.com",homepage:"http://www.peggy.com"}, {name:"Peggy",email:"peggy @gmail.com",homepage:"http://www.peggy.com"},
{name:"Peggy",email:"peggy@gmail.com",homepage:"http://www. peggy.com"}
]
3, The value can be a string, number, true, false, null, or an object or array. These structures can be nested.
This article comes from cssrain.cn Original link: http://www.cssrain.cn/article.asp?id=488

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