json_decode
json_decode — Decodes a JSON string.Description
json_decode( string $json,Takes a JSON encoded string and converts it into a PHP variable.
?bool $associative = null,
int $depth = 512,
int $flags = 0 ): mixed
Parameters
json
The json string being decoded.
associative
When true, JSON objects will be returned as associative arrays; when false, JSON objects will be returned as objects. When null, JSON objects will be returned as associative arrays or objects depending on whether JSON_OBJECT_AS_ARRAY is set in the flags.
depth
Maximum nesting depth of the structure being decoded.
flags
Bitmask of JSON_BIGINT_AS_STRING, JSON_INVALID_UTF8_IGNORE, JSON_INVALID_UTF8_SUBSTITUTE, JSON_OBJECT_AS_ARRAY, JSON_THROW_ON_ERROR. The behaviour of these constants is described on the JSON constants page.
Return Values
Returns the value encoded in json in appropriate PHP type. Values true, false and null are returned as true, false and null respectively. null is returned if the json cannot be decoded or if the encoded data is deeper than the nesting limit.More information about json_decode on official PHP documentation site
json_decode - Popular snippets
- PHP 8.0 / MySQL 5.7 var_export json_decode array_reduce array_values
last run:
2023-03-08 07:24:08
27
- PHP 8.0 / MySQL 5.7 json_decode json_encode
last run:
2021-12-09 20:42:25
14
- PHP 7.4 / MySQL 5.7 curl_init curl_setopt curl_exec json_decode
last run:
2023-01-20 12:45:03
9
- PHP 8.1 / MySQL 5.7 json_decode preg_match array_filter var_dump str_replace
last run:
2023-08-30 06:27:32
8
- PHP 8.1 / MySQL 5.7 json_decode print_r
last run:
2022-09-17 10:23:25
8
- PHP 8.0 / MySQL 5.7 json_decode array_column print_r
last run:
2023-08-31 07:55:34
8
- PHP 8.0 / MySQL 5.7 error_reporting var_dump json_decode json_encode
last run:
2022-02-09 14:08:16
8
- PHP 8.0 / MySQL 8.0 json_decode print_r
last run:
2021-08-23 20:54:56
7
- PHP 8.0 / MySQL 5.7 json_decode
last run:
2021-08-09 08:42:21
7
- PHP 8.0 / MySQL 5.7 file_get_contents json_decode
last run:
2023-02-12 19:24:46
6
json_decode - New snippets
-
PHP 8.1 / MySQL 5.7 json_decode file_get_contents date json_encode
added at:
2023-09-26 19:10:46
1
-
PHP 8.1 / MySQL 5.7 json_decode file_get_contents date json_encode
added at:
2023-09-26 19:10:34
1
-
PHP 8.1 / MySQL 5.7 json_decode file_get_contents date json_encode
added at:
2023-09-26 19:10:26
1
-
PHP 8.1 / MySQL 5.7 json_decode print_r
added at:
2023-09-04 11:27:21
1
-
PHP 8.1 / MySQL 5.7 json_decode print_r
added at:
2023-09-04 11:26:08
1
-
PHP 8.0 / MySQL 5.7 json_decode print_r
added at:
2023-08-31 08:14:13
2
-
PHP 8.0 / MySQL 5.7 json_decode print_r
added at:
2023-08-31 08:14:10
1
-
PHP 8.0 / MySQL 5.7 json_decode print_r
added at:
2023-08-31 08:13:57
1
-
PHP 8.0 / MySQL 5.7 json_decode print_r
added at:
2023-08-31 08:13:45
1
-
PHP 8.0 / MySQL 5.7 json_decode print_r
added at:
2023-08-31 08:13:40
1