What Is Different Between Array And JSON With Example

admin_img Posted By Bajarangi soft , Posted On 18-01-2021

Array and JSON is most widely used terms. So today we discuss in detail what is the difference between array and json.

What Is Different Between Array And JSON With Example

Different Between Array And JSON
 

Array

JSON

An array is a special variable, which can hold more than one value at a time.

JSON format is easy to understanding and for storing and transporting data.JSON is often used when data is sent from a server to a web page.JSON is "self-describing" and easy to understand.

An array is a data structure common for all programming languages which contains a number of variables in a specific order. A JSON Object is a serialisation of a collection of key/value pairs.
Most programming languages have a matching data structure, such as a hash in Perl or a (simple) object in JavaScript.
Array can create by key and value if you want or default it will have index value as key value JSON always have key and value
Example:
$bike = array("Bike1", "Bike2", "Bike3");
Example:
{"employees":[
{ "firstName":"John", "lastName":"Doe" },
{ "firstName":"Anna", "lastName":"Smith" },
{ "firstName":"Peter", "lastName":"Jones" }
]}
 
 

Related Post