Home  >  Article  >  Web Front-end  >  Why use json

Why use json

little bottle
little bottleOriginal
2019-05-29 10:49:434304browse

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.

Why use 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!

Statement:
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