What is json? json is the abbreviation of JavaScript Object Notation, which translates to js object notation. To put it simply, it is a lightweight data exchange format.
#JSON is a lightweight data exchange format.
JSON adopts a completely language-independent text format, but also uses habits similar to the C language family. These properties make JSON an ideal data exchange language. Easy for humans to read and write, and easy for machines to parse and generate.
JSON is JavaScript Object Notation.
JSON is a syntax for storing and exchanging text information. Similar to XML.
JSON is smaller, faster, and easier to parse than XML.
The json format file is a file with the suffix .json.
This kind of file can be opened with Notepad, a browser, or a file editor.
There are many kinds of file editors, such as sublime text, notepad and other file editors, which can be used to open json format files.
In use, json has the following three structures:
Object: {"name":"Michael","age":24}
Array: [{"name":"Michael","age":24},{"name":"Tom","age":25}]
Value: {"name":" Michael", "birthday":{"month":8,"day":26}}, similar to object nested objects.
Many people wonder about the difference between {} and [] forms. I saw a very classic summary:
Braces {} are used to describe a set of "different types of unordered key-value pair sets" (each key-value pair can be understood as an OOP attribute description ), square brackets [] are used to describe a set of "ordered data sets of the same type" (which can correspond to OOP arrays).
The above is the detailed content of What is the json data format?. For more information, please follow other related articles on the PHP Chinese website!