note 76685 deleted from function.json-decode by googleguy
| From: | googleguy@php.net | Date: | Fri, 30 Nov 2012 05:52:29 +0000 |
| Subject: | note 76685 deleted from function.json-decode by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-192227@lists.php.net to get a copy of this message | ||
Note Submitter: yasarbayar at gmail dot com
----
It took me a while to find the right JSON string format grabbed from mysql to be used in
json_decode(). Here is what i came up with:
Bad(s) (return NULL):
{30:'13',31:'14',32:'15'}
{[30:'13',31:'14',32:'15']}
{["30":"13","31":"14","32":"15"]}
Good :
[{"30":"13","31":"14","32":"15"}]
returns:
array(1) { [0]=> array(3) { [30]=> string(2) "13" [31]=> string(2)
"14" [32]=> string(2) "15" } }
hope this saves sometime..