json_decode 溢出

有时候会遇到json_decode()解析的字符串中有个长整型,解析成1.0E….之类的溢出问题。
解决办法根据php的版本不同而不同:
PHP5.4以上的可以配置下json_decode(),解析的时候这么写就好
//$de_res为需要解析的值;
json_decode($de_res,true, 512, JSON_BIGINT_AS_STRING);

posted @ 2018-07-23 14:57  qqisnow2021  阅读(200)  评论(0编辑  收藏  举报