Home >Web Front-end >JS Tutorial >Why use json
I believe many people have heard of json, but don’t know what json is? I don’t know why json is used? Let's take a look at json.
What is json?
JSON is a data exchange format and an open format based on a subset of js syntax , which is generally read by programs and uses completely independent other programming languages to store data. The hierarchical structure makes json a data exchange language.
What is json used for?
json is mainly used to transmit strings in data. The objects of json are JSON key/value pairs, arrays and other objects.
What is the relationship between JSON and JS objects?
Many people always regard JSON and JS as the same concept. In fact, JSON is a representation method of js string, and JSON and js objects can be converted to each other. JSON converts the data in js into a string and then passes it before the program. It can be restored in various programming languages. For example, in php, JSON data can be restored into an array. When we use AJAX, If you pass a value by value, JSON will be used to convert the array into a string.
The above is the detailed content of Why use json. For more information, please follow other related articles on the PHP Chinese website!