Json_decode long integer, loss of precision, why windowxp, how to deal
Source: Internet
Author: User
Json_decode is a long integer with a loss of precision. why is the tid precision lost in the following php conversion process of windowxp? the last four digits, 6788 digits, are changed to 7000. why? Str = '{& quot; receiver_address & quot;: & quot; Suining city, Sichuan province & quot;, & quot; receiver_city & quot;: & json_decode long integer, loss of precision, why Windows xp
In the following php conversion: tid precision will be lost, and the last four digits, 6788, will become 7000. why?
Test environment:
A: centOS5 + php5 * can be correctly converted,
B: window xp + php526 + Apache2.2, error, loss of precision.
Thank you for your attention.
------ Solution --------------------
114757372016788 if it is a numerical value, it is beyond the range expressed by the long integer of a 32-bit machine.
You should treat it as a string, just like sid
------ Solution --------------------
Encoding problems
------ Solution --------------------
Double quotation marks on both sides of the number into a string for a try
------ Solution --------------------
The php module installed on linux is different from that installed on Windows, or the php configuration is different. Therefore, the calculation method of json_decode is different.
If you don't know how to do it, the simplest method is to convert the string into an integer in the js script.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.