1

I have some json that i decode using json decode,

however I have floats in the json file, like "58.939020934234" and json_decode parses it as a float (just like it should) however on large numbers its chopping off the ends ( again, like it should ) however this is really bad and I need to find a way to FORCE json_decode to parse EVERYTHING as a string.

I read the documentation and the forth parameter is a flag and we can pass the const JSON_BIGINT_AS_STRING which I think is what I need, however when I try this i get an error saying json_decode does not accept 4 arguments! I'm running php5.

Does anybody know of another I could force this json to be parsed as string?

AlexMorley-Finch
  • 6,785
  • 15
  • 68
  • 103

1 Answers1

0

The options parameter was added in PHP 5.4, which isn't stable yet. This from the changelog on the man page for json_decode:

5.4.0    The options parameter was added.
Matthew
  • 15,464
  • 2
  • 37
  • 31