Function: json_to_array()

function json_to_array(string &$json, array &$array): void;

Converts the JSON string to an array.

Details

It is a wrapper over the system function json_decode. It is introduced to give the ability to overwrite the system function if necessary.

Parameters

Name Pass type Value type Default value Description
$json by reference string

Input JSON string.

$array by reference array

target array.

Returns

void

Throws

\Exception

It might throw the exception if the JSON cannot be parsed.

Authors

Oleg Schildt

Package

Source code