Function: array_to_json()

function array_to_json(array &$array): string;

Converts the array to JSON string.

Details

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

Parameters

Name Pass type Value type Default value Description
$array by reference array

Array to be converted.

Returns

string

Returns the JSON string of the array.

Authors

Oleg Schildt

Package

Source code