note 114767 added to function.json-decode
| From: | nsardo | Date: | Thu, 03 Apr 2014 11:42:58 +0000 |
| Subject: | note 114767 added to function.json-decode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-199112@lists.php.net to get a copy of this message | ||
Just a quick note, as I got caught with this:
The json that is input into json_decode MUST be well formed, such that key's are QUOTED. I
wasted time debugging, a$$suming that the following would be fine:
[{id:2, name:"Bob",phone:"555-123-4567"}]
It returned null, basically. I had to QUOTE the keys:
[{"id":2, "name":"Bob", "phone":"555-123-4567"}]
THEN, everything worked as it should.
----
Server IP: 64.71.164.2
Probable Submitter: 68.203.11.27
----
Manual Page -- http://php.net/manual/en/function.json-decode.php
Edit -- https://master.php.net/note/edit/114767
Del: integrated -- https://master.php.net/note/delete/114767/integrated
Del: useless -- https://master.php.net/note/delete/114767/useless
Del: bad code -- https://master.php.net/note/delete/114767/bad+code
Del: spam -- https://master.php.net/note/delete/114767/spam
Del: non-english -- https://master.php.net/note/delete/114767/non-english
Del: in docs -- https://master.php.net/note/delete/114767/in+docs
Del: other reasons-- https://master.php.net/note/delete/114767
Reject -- https://master.php.net/note/reject/114767
Search -- https://master.php.net/manage/user-notes.php