a::json($array)

Converts an array to a JSON string It's basically a shortcut for json_encode()

  • $array (array)
    The source array
  • return (string)
    The JSON string

Example

$array = array(
  'cat'  => 'miao',
  'dog'  => 'wuff',
  'bird' => 'tweet'
);

echo a::json($array);

Result:

{"cat":"miao","dog":"wuff","bird":"tweet"}

Is something missing or incorrect? Edit this page on Github…