Skip to main content
Stack Overflow
  1. About
  2. For Teams

Timeline for Errors with json_decode in php

Current License: CC BY-SA 3.0

Post Revisions

22 events
when toggle format what by license comment
Oct 22, 2014 at 9:49 vote accept Community Bot
Dec 29, 2014 at 18:49
Oct 22, 2014 at 9:49 vote accept Community Bot
Oct 22, 2014 at 9:49
Oct 22, 2014 at 8:33 answer added Leo Loki timeline score: 0
Oct 22, 2014 at 0:01 comment added zerkms @learner: do we need to guess or read your mind to get the newest data example? <-- it's not irony, I accept that you may think we can read minds, since providing data in such a question must be obvious for anyone.
Oct 21, 2014 at 23:48 comment added zerkms @learner: you could contact data provider and ask them how to request the data in UTF-8 properly
Oct 21, 2014 at 23:48 answer added Darren timeline score: 1
Oct 21, 2014 at 23:47 comment added user2881809 @zerkms i see it, me need delete this or other action?
Oct 21, 2014 at 23:46 comment added zerkms >>> windows-1251 <<< JSON document must be in UTF-8
Oct 21, 2014 at 23:45 comment added user2881809 @Darren we get Json from CURL, full code pastebin.com/mRxZZEMY But what me need doing that i can get value?
Oct 21, 2014 at 23:41 comment added Darren +1 to zerks answer. That's your issue. If you don't mind, where are you getting this json from?
Oct 21, 2014 at 23:40 comment added zerkms That string has broken UTF characters. JSON string must be a valid UTF string. But even that string does work fine (on php 5.3)
Oct 21, 2014 at 23:38 comment added zerkms @learner: I copied your JSON as-is and it works
Oct 21, 2014 at 23:37 comment added user2881809 @zerkms in your code { "list":[{{ instead of { "list":[{
Oct 21, 2014 at 23:35 comment added user2881809 @Darren i get string(99) "{ "list":[{"id":"4045","value":"Xin Kai"},{"id":"4141","value":"YZK"},{"id":"4099","value":"ZX"}]}"
Oct 21, 2014 at 23:34 comment added zerkms ideone.com/zzoQHd - it works
Oct 21, 2014 at 23:32 comment added Darren @learner what do you get in that var_dump($result)? The full string. because as your example sits, it works: eval.in/208543
Oct 21, 2014 at 23:32 comment added user2881809 if i make var_dump($result), i get string...
Oct 21, 2014 at 23:30 comment added user2881809 @imel96 problem with decode becouse i make var_dump($json) and i get NULL, but where error in decode?
Oct 21, 2014 at 23:27 comment added imel96 what var_dump($json) gives you?
Oct 21, 2014 at 23:22 history undeleted Community Bot
Oct 21, 2014 at 23:22 history deleted Community Bot via Vote
Oct 21, 2014 at 23:21 history asked user2881809 CC BY-SA 3.0
toggle format

AltStyle によって変換されたページ (->オリジナル) /