rfc:json_encode_indentation
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
rfc:json_encode_indentation [2021/06/03 13:57] โ tdgroot | rfc:json_encode_indentation [2021/06/03 14:04] โ tdgroot | ||
---|---|---|---|
Line 18: | Line 18: | ||
$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