Sepideh
Sepideh

Reputation: 133

how can json_decode string whitout change my longint value?

I have a "json" string that contain long int value when i want to json_decode long int value changes to float(3.6677890000187E+14) help me please thanks

Upvotes: 0

Views: 37

Answers (1)

Kunal Awasthi
Kunal Awasthi

Reputation: 320

use JSON_BIGINT_AS_STRING as 2nd argument for json_decode like below

json_decode($str, false, 512, JSON_BIGINT_AS_STRING)

php.net/manual/en/function.json-decode.php

Upvotes: 1

Related Questions