1

我有一串以这种方式编码的文本:

 {"itemId":"17417362","type":"0","cclass":0,"value":"100","category":null,"image":{"url":"\/\/cdn.site.com\/insight.site.com\/COS20\/_Cache\/_ImageCache\/362\/17417362.gif","height":"100","width":"80"},"burstText":"","summary":"SAVE $1.00 ON TWO","brand":"Big \u00ae","link_text":"","link_url":"","activated":"2012-09-01T00:01:00","expiration":"2012-10-31T23:59:00","isuff":"362\/17417362.gif","imagePrefix":null,"details":"when you buy TWO BOXES: Original \u00ae ...","catid":"531","catdesc":"Ready to Eat","slot":"-415","prodinfo":"when you buy TWO BOXES any flavor: Original \u00ae \u2022 \u00ae \u202 \u00ae...","cpnuse":"1","printed":null,"actiontaken":null,"printCount":null,"onCard":null,"sid":"11079187","fid":"06338174","videoURL":"","catlevel1":"107","catlevel2":"399","catlevel3":"531","catdesc1":"Foods","catdesc2":"Breakfast","catdesc3":"Ready to Eat","restricted":0},"17557036":

我已经在这个字符串上尝试了 json_decode,但它失败了。我认为这是由于特殊字符和一般格式。我该如何清理它以进行解码?

4

1 回答 1

3

对于初学者来说,你的字符串突然终止:"17557036":是它的最后一个 - 因此,不是格式良好的 JSON。

于 2012-09-15T02:14:47.543 回答