Handling big user IDs returned by FQL in PHP

后端 未结 6 2198
时光说笑
时光说笑 2020-11-29 09:30

I\'m using FQL to retrieve a list of users from Facebook. For consistency I get the result as JSON. This causes a problem - since the returned JSON encodes the user IDs as n

6条回答
  •  不知归路
    2020-11-29 09:46

    json_decode() can convert large integers to strings, if you specify a flag in the function call:

    $array = json_decode($json, true, 512, JSON_BIGINT_AS_STRING)
    

提交回复
热议问题