Our server does not have the latest PHP versions, thus I cannot use json_decode. I tried to use the PEAR one: http://mike.teczno.com/JSON/JSON.phps, but the dataset is huge and it got the 30 seconds time out error – 30 seconds is unacceptable run time anyways.
I stumbled across this: http://www.php.net/manual/en/function.json-decode.php#108552
It almost works.
My JSON is in this form:
[{"number1":3,"number2":5,"time":"Jul 30, 2012 1:05:07 PM","value1":"aa","value2":"bb"}]
As you can see, the “number1” and “number2” fields have values that aren’t enclosed by double quotations, which breaks the custom json_decode.
Does anyone know how to modify or provide a json_decode that can overcome this?
As suggested in the comments, I used http://include-once.org/p/upgradephp which seems to work as a good json_decode() fallback.