note 84267 deleted from function.json-decode by googleguy

From: Date: Fri, 14 Jun 2013 10:03:49 +0000
Subject: note 84267 deleted from function.json-decode by googleguy
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-195212@lists.php.net to get a copy of this message
Note Submitter: ganswijk at xs4all dot nl ---- It was quite hard to figure out the allowed Javascript formats. Some extra remarks: json_decode() doesn't seem to allow single quotes: <?php print_r(json_decode('[0,{"a":"a","b":"b"},2,3]')); //works print_r(json_decode("[0,{'a':'a','b':'b'},2,3]")); //doesn't work ?> json_decode() doesn't allow an extra comma in a list of entries: <?php print_r(json_decode('[0,1 ]')); //works print_r(json_decode('[0,1,]')); //doesn't work ?> (I like to write a comma behind every entry when the entries are spread over several lines.) json_decode() does allow linefeeds in the data! ?>

« previous php.notes (#195212) next »