Skip to content

Instantly share code, notes, and snippets.

@dazz
Last active December 24, 2015 00:09
Show Gist options
  • Save dazz/6714589 to your computer and use it in GitHub Desktop.
Save dazz/6714589 to your computer and use it in GitHub Desktop.
var_dump(json_encode(
array()
));
// [ ]
var_dump(json_encode(
array('foo')
));
// ["foo"]
var_dump(json_encode(
array('foo' => 'bar')
));
// {"foo": "bar"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment