JSON Interview Questions and Answers

What is JSON?
JSON: JavaScript Object Notation is a tool to exchange data. It is defined as a javascript object. Using JSON we can store javascript Objects as text. When it will be required we can convert text into objects.

Is it possible to have an array of JSON or JSON having the array as values?
Yes, it is possible to do so. We can define a key in JSON having an array as value and we also can define an array having a JSON as value.

What is the use of JSON?
JSON is used to exchange data from the server. Since it is a text string, it is faster than any other format like XML.

What is JSON.parse() ?
JSON.parse() , parse the JSON string and return an full fetured object.

What is JSON.stringify()?
JSON.stringify(), convert the JSON Objects into string.

How can we handle the JSON in PHP?
PHP provides functions to handle the JSON. We can parse JSON using PHP and can convert it into an array. Function we use to convert a JSON to Object is json_decode(); json_decode() convert Javascript Object into PHP object. If we pass second argument in it as “true” it will return an associative array.


What is JSONP?
JSONP is called JSON with Padding. This is used to exchange data on cross sites protocols.

Spread the love
  • 25
  • 10
  •  
  • 8
  •  
  •  
    43
    Shares

Related Posts

interview-questions-answers-pdf

Interview Questions and Answers in PDF

Magento Interview Questions and Answers DOWNLOAD PDF Laravel Interview Questions and Answers DOWNLOAD PDF Angular
magento-interview-questions-answers

Magento Interview Questions and Answers for Freshers

What is Magento? Magento is an open-source e-commerce platform written in PHP. Originally designed and
laravel-interview-questions-answers

Laravel Interview Questions And Answers

What is Laravel? Laravel is a PHP based web development frame work and an Open