Fork me on GitHub

php json_decode int类型溢出 变float类型

php在  json_decode  时候可能出现json 数据中 int 类型 过长,转为数组变成float 类型

$post = json_decode($content,true);
 
float 2.0423412312312E+16

可改成:

$post = json_decode($content,true,512,JSON_BIGINT_AS_STRING);

  参考原文:https://www.cnblogs.com/lclclouds/p/11327259.html

posted @ 2020-07-17 18:01  君乐豹  阅读(467)  评论(0编辑  收藏  举报
Live2D