This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
uphp:functions:json_encode [2017/03/28 17:57] jeff created |
uphp:functions:json_encode [2021/09/13 05:57] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
======json_encode====== | ======json_encode====== | ||
+ | |||
< | < | ||
- | JSON encode an array into a string, with optional method | + | < |
====Description==== | ====Description==== | ||
- | <well size=" | + | <well size=" |
- | <span style=" | + | <span style=" |
- | < | + | <span style=" |
- | <span style=" | + | <span style=" |
- | <span style=" | + | <span style=" |
- | <span style=" | + | <span style=" |
- | <span style=" | + | <span style=" |
- | <span style=" | + | <span style=" |
- | <span style=" | + | <span style=" |
</ | </ | ||
- | Return a string containing the JSON((JSON stands for " | + | Return a < |
====Parameters==== | ====Parameters==== | ||
- | < | + | <html><b>< |
+ | |||
+ | < | ||
+ | * **0** - object (default for < | ||
+ | * **1** - array (without keys) | ||
- | < | + | ====Return Values==== |
- | * **0** - Output JSON code to represent an object (default for $method not specified) | + | |
- | * **1** - Output JSON code to represent an array (without keys) | + | |
- | ====Return Value==== | + | JSON encoded |
- | JSON encoded string | + | |
====Example==== | ====Example==== | ||
Line 62: | Line 64: | ||
====See Also==== | ====See Also==== | ||
- | [[array()]] - Create an array, with optional values | + | [[array()]] - Create an < |
- | [[explode()]] - Turn a string into an array | + | [[explode()]] - < |
- | [[implode()]] - Turn an array into a string | + | [[implode()]] - < |
[[uphp: | [[uphp: | ||