Difference between revisions of "JSON ENCODE()"
From Lianjapedia
Yvonne.milne (Talk | contribs) |
Barrymavin (Talk | contribs) |
||
Line 1: | Line 1: | ||
==Purpose== | ==Purpose== | ||
Function to create a JSON formatted string from a dynamic array (object) | Function to create a JSON formatted string from a dynamic array (object) | ||
− | + | [[Category:Data Integration]] | |
==Syntax== | ==Syntax== | ||
JSON_ENCODE(<object>|<array>) | JSON_ENCODE(<object>|<array>) |
Revision as of 21:10, 8 December 2017
Contents
Purpose
Function to create a JSON formatted string from a dynamic array (object)
Syntax
JSON_ENCODE(<object>|<array>)
See Also
ACLASS(), ADDPROPERTY(), AMEMBERS(), COMPOBJ(), CREATEOBJECT(), DEFINE CLASS, DISPLAY CLASSES, DODEFAULT(), FOREACH, JSON_DECODE(), JSON_DECODE_FILE(), LIST CLASSES, LOADOBJECT(), NEWOBJECT(), OBJECT(), ODATA_CREATE(), ODATA_DELETE(), ODATA_READ(), ODATA_UPDATE(), PRINT_JSON(), PRINT_HTML(), PRINT_R(), PRINT_XML(), REMOVEPROPERTY(), REQUIRE_ONCE(), SAVEOBJECT(), SQL SELECT, WITH, XML_DECODE_FILE()
Description
The JSON_ENCODE() function is used to create a JSON formatted string from the dynamic array, <object> or <array>. For strings larger than 64K use the PRINT_JSON() function.
Example
myobj = json_decode('{"Name":"Barry", "Company":"Lianja", "Items":["One", "two"]}') ? json_encode(myobj)
{"name":"Barry","company":"Lianja","items":["One","two"]}