|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2015-06-26 01:42 UTC] floriparob at gmail dot com
Description: ------------ Using json_decode to turn a JSON string into an associative array. If it finds duplicate key:value pairs it drops the duplicate. It would be handy to have an option to keep or not to keep these duplicates. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 13:00:01 2025 UTC |
That's not possible: arrays can't have duplicate keys. What if it decoded into an array of values? Like {a:1,a:2} decoded to [a=>[1,2]]?What am I saying? {a:1,a:2} doesn't make sense as JSON either. Do you have any examples of where this would be useful *and* are not due to flawed JSON encoders?