基于 Twitter API 游标的分页(JSON 问题) PHP [英] Twitter API cursor based pagination (JSON issue) PHP

查看:36
本文介绍了基于 Twitter API 游标的分页(JSON 问题) PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如您所知,Twitter 已针对某些 API 方法发布了基于光标的新分页.

as you know Twitter has posted a new cursor based pagination for some API methods.

目前,我在编码 json 对象时遇到问题,因为游标本身实际上是一个 64 位数字,并且不支持 PHP 中的 json 编码.

Currently, I'm facing a problem when encoding the json object because the cursor itself is actually a 64-bit numbers and not supported for json encoding in PHP.

next_cursor 1299072354878293926

有什么解决办法吗?我无法相信为什么 Twitter 不直接为它返回字符串...嗯

Any solution for this? I can't believe why didn't Twitter just return string for it...hmmp

谢谢

推荐答案

PHP 5.2+ 应该将 64 位数字转换为浮点数,这比以前的 PHP 版本更好(只会将其转换为最大 32 位值).最好的办法是迁移到 64 位版本的 PHP,但更新到 PHP 5.2+ 至少能让您启动并运行.

PHP 5.2+ should convert 64-bit numbers to floats, which is better than previous versions of PHP (which would just convert it to the maximum 32-bit value). Best bet is to move to a 64-bit version of PHP, but updating to PHP 5.2+ will at least get you up and running.

这篇关于基于 Twitter API 游标的分页(JSON 问题) PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆