PHP json_decode skips part of source JSON

后端 未结 2 1109
失恋的感觉
失恋的感觉 2021-01-22 12:39

I have a problem with a piece of JSON and PHP\'s json_decode(). We receive JSON from a customer\'s publishing solution, and although it validates, json_decod

2条回答
  •  轮回少年
    2021-01-22 13:01

    just to add a possible option...

    the library jsonlint can be used to validate your json string. It will take arguments to either ignore/detect duplicate keys.

    whilst this wont fix your problem, at least youd be able to detect any errors so avoiding data corruption.

提交回复
热议问题