User Tools

Site Tools


uphp:functions:json_decode

json_decode

WMMEGA FW >= 2.1180

JSON decode a string into a array

Description

array json_decode ( string $data )

Return an array containing the JSON array representation of an JSON object (passed as a string).

Parameters

$data: A string to decode

Return Values

JSON decoded array

Example

<pre><?
   $json_string='{"a":1,"b":2,"c":3}';
   $res=json_decode($json_string);
   print_r($res);
?></pre>

The above example will output:

[$res] = Array (
[0] = Array (
    (int) [a] => 1
    (int) [b] => 2
    (int) [c] => 3
)
) 

See Also

array() - Create an array, with optional values

explode() - Turn a string into an array

implode() - Turn an array into a string

json_encode() - Encode an array as a JSON string

uPHP Variable Types and Limits

uphp/functions/json_decode.txt · Last modified: 2021/11/15 04:05 by admin