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-11-30 18:57:30
29
- PHP 8.1 / MySQL 5.7 file_get_contents json_decode date
last run:
2023-10-25 16:02:10
21
- PHP 8.1 / MySQL 5.7 file_get_contents simplexml_load_string json_decode print_r
last run:
2024-01-19 17:53:03
15
- PHP 8.0 / MySQL 5.7 json_decode json_encode
last run:
2021-12-09 20:42:25
14
- PHP 8.1 / MySQL 5.7 file_get_contents json_decode print_r
last run:
2024-01-19 17:41:51
13
- PHP 8.1 / MySQL 5.7 file_get_contents simplexml_load_string json_encode json_decode is_array in_array end
last run:
2023-11-12 20:48:05
13
- PHP 8.1 / MariaDB 11.4 file_get_contents json_decode print_r
last run:
2024-10-23 16:29:03
12
- PHP 8.1 / MySQL 5.7 file_get_contents simplexml_load_string json_encode json_decode print_r
last run:
2024-02-28 17:46:26
12
- PHP 8.1 / MySQL 5.7 file_get_contents simplexml_load_string json_encode json_decode print_r array_unique
last run:
2023-11-01 17:43:41
12
- PHP 8.1 / MySQL 5.7 file_get_contents json_decode print_r
last run:
2023-11-01 17:04:53
12
json_decode - New snippets
-
PHP 8.2.13 / MySQL 8.0 join array_replace substr_replace json_decode
added at:
2024-12-02 07:44:24
1
-
PHP 8.2.13 / MySQL 8.0 join array_replace substr_replace json_decode
added at:
2024-12-02 07:41:56
1
-
PHP 8.2.13 / MySQL 8.0 join array_replace substr_replace json_decode
added at:
2024-12-02 07:40:53
1
-
PHP 8.2.13 / MySQL 5.7 var_dump json_decode
added at:
2024-11-28 12:51:46
1
-
PHP 8.2.13 / MySQL 5.7 var_dump json_decode
added at:
2024-11-28 12:51:41
1
-
PHP 8.2.13 / MySQL 5.7 var_dump json_decode
added at:
2024-11-28 12:51:26
1
-
PHP 8.2.13 / MySQL 5.7 var_dump json_decode
added at:
2024-11-28 12:51:18
1
-
PHP 8.2.13 / MySQL 5.7 var_dump json_decode
added at:
2024-11-28 12:50:11
1
-
PHP 8.2.13 / MySQL 5.7 var_dump json_decode
added at:
2024-11-28 12:49:43
1
-
PHP 8.2.13 / MySQL 5.7 var_dump json_decode
added at:
2024-11-28 12:49:33
1