rfc:json_encode_indentation
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
rfc:json_encode_indentation [2021/06/03 13:57] โ tdgroot | rfc:json_encode_indentation [2021/06/03 15:23] โ tdgroot | ||
---|---|---|---|
Line 3: | Line 3: | ||
* Date: 2021-06-03 | * Date: 2021-06-03 | ||
* Author: Timon de Groot, tdegroot96@gmail.com | * Author: Timon de Groot, tdegroot96@gmail.com | ||
+ | * Implementation: | ||
* Status: Draft | * Status: Draft | ||
Line 18: | Line 19: | ||
$data = [ | $data = [ | ||
' | ' | ||
- | ' | + | ' |
]; | ]; | ||
+ | echo json_encode([' | ||
echo json_encode($data, | echo json_encode($data, | ||
- | echo json_encode($data, JSON_PRETTY_PRINT, | + | echo json_encode([' |
+ | echo json_encode([' | ||
?> | ?> | ||
</ | </ | ||
- | < | + | < |
+ | {ย | ||
+ | " | ||
+ | } | ||
{ | { | ||
" | " | ||
" | " | ||
- | | + | 2 |
- | 1,ย | + | |
- | | + | |
- | 3 | + | |
] | ] | ||
} | } | ||
{ | { | ||
- | ๐"key": | + | ๐๐"unicode": "supported"ย |
- | ๐"other_key": [ย | + | }ย |
- | ๐๐0,ย | + | {ย |
- | ๐๐1,ย | + | " |
- | ๐๐2, | + | |
- | ๐๐3ย | + | |
- | ๐] | + | |
} | } | ||
</ | </ |
rfc/json_encode_indentation.txt ยท Last modified: 2022/07/19 15:23 by cmb