Write to the mobile interface, the JSON data, sometimes {} sometimes is [] , I always silly, and then check the JSON data structure;
We need to understand what JSON is;
- JSON refers to the JavaScript object notation (JAvaScript Object Notation)
- JSON is a lightweight text data interchange Format
- JSON independent of Language *
- JSON is self-descriptive and easier to understand
The format of JSON is
If it is a {} object, then it is the format of the Key:value one is connected with a comma of "," in English;
If it is an [] array, then only the value, the format of value, is concatenated with a comma of "," in English;
{} and [] can be nested with each other, but there must be an end at the beginning;
Object:{}The data structure is a key-value pair structure of {key1:value1, key2:value2, ...}, array: [] data structure for ["Java", "JavaScript", "VB", ...] index structure,
For a chestnut: PHP data structure
EchoJson_encode ([[' A '],[[' B '],[[1,2, ' 3 '=4] ]], json_unescaped_unicode);
The Json_encode output of the page is as follows;
For data that goes to JSON, there are []There are some of the essential differences of {} , that is, the problem of data structure, there is a key value to that is {} is treated as object; as array processing,
This is a fuzzy idea of the JSON data structure,
The difference between PHP to the mobile interface [] and {}