Skip to content

Instantly share code, notes, and snippets.

@mgng
Created June 12, 2012 06:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgng/2915656 to your computer and use it in GitHub Desktop.
Save mgng/2915656 to your computer and use it in GitHub Desktop.
<?php
$s = '{"":123, "a":456}';
var_dump( json_decode($s) );
//object(stdClass)#1 (2) {
// ["_empty_"]=>
// int(123)
// ["a"]=>
// int(456)
//}
<?php
$s = '{"":123, "_empty_":456}';
var_dump( json_decode($s) );
//object(stdClass)#1 (1) {
// ["_empty_"]=>
// int(456)
//}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment