JSON Decode

Free online JSON to array converter. Just load your JSON and it will automatically get converted to a array. Load JSON, get a array.This tool extracts all array values from a JavaScript Object Notation (JSON) file. It ignores all JSON notation characters and leaves just array Super simple!

PHP JSON Decode

The json_decode() function is an inbuilt function in PHP which is used to decode a JSON string. It converts a JSON object to a PHP object.

JSON stands for JavaScript Object Notation. The JSON data is saved in json file. The JSON data consist of a series of key & value pairs. The JSON data used to transfer data between the server and the browser.

Here is a example decode JSON string into PHP object.

Syntax

The syntax for the JSON Encode is following.

JSON Decode Syntax

Parameters

  • json: Required. It specifies the values to be decoded. This function only works with UTF-8 encoded strings.
  • assoc: Optional. It specifies a Boolean value. If it is true, the object will be converted into an associative array. If it is false, it returns an object. False is default.
  • depth: Optional. It specifies the recursion depth, default recursion depth is 512.
  • options: Optional. It specifies a bitmask (JSON_INVALID_UTF8_SUBSTITUTE, JSON_OBJECT_AS_ARRAY, JSON_BIGINT_AS_STRING, JSON_INVALID_UTF8_IGNORE, JSON_THROW_ON_ERROR)

Example

The json_decode() function return a string in PHP object

Let's see the following example for JSON string

JSON Decode Example

The above example will give output

JSON Decode Output