json.md 329 B


layout: default title: JSON

permalink: /terminal-objects/json/

JSON

The json method outputs pretty-printed JSON to the terminal:

$climate->json([
  'name' => 'Gary',
  'age'  => 52,
  'job'  => 'Engineer',
]);
{
    "name": "Gary",
    "age": 52,
    "job": "Engineer"
}