======json_encode====== WMPRO, WMMINI FW >= 1.0 WMMEGA FW >= 2.0 JSON encode an array into a string, with optional method ====Description==== string json_encode ( array $array [, int $method ] ) Return a string containing the JSON((JSON stands for "JavaScript Object Notation." It is a lightweight format that is used for data interchanging. It is based on a subset of the JavaScript language (the way objects are built in JavaScript).)) encoded representation of an array ====Parameters==== $array: An array to parse $method: Optional, output the JSON code string to represent an //object// or an //array//: * **0** - object (default for $method not specified) * **1** - array (without keys) ====Return Values==== JSON encoded string ====Example====
The above example will output: "$arr":{"a":1,"b":2,"c":3} "$arr":{"a":1,"b":2,"c":3} "$arr":{1,2,3] ====See Also==== [[array()]] - Create an array, with optional values [[explode()]] - Turn a string into an array [[implode()]] - Turn an array into a string [[uphp:variables|uPHP Variable Types and Limits]]