单击此https://api.twitter.com/1/followers/ids.json?screen_name=USER_NAME
它返回;
{"ids":[XXXXXXXXXXX,XXXXXXXXXXXX,XXXXXXXXXXX,.........],"next_cursor":0,"next_cursor_str":"0","previous_cursor":0,"previous_cursor_str":"0"}
以及如何将这些 id 保存到 PHP 上的数组中?
单击此https://api.twitter.com/1/followers/ids.json?screen_name=USER_NAME
它返回;
{"ids":[XXXXXXXXXXX,XXXXXXXXXXXX,XXXXXXXXXXX,.........],"next_cursor":0,"next_cursor_str":"0","previous_cursor":0,"previous_cursor_str":"0"}
以及如何将这些 id 保存到 PHP 上的数组中?
$data = file_get_contents("https://api.twitter.com/1/followers/ids.json?screen_name=$USER_NAME");
$array = json_decode($data, true);
if (isset($array['ids']) && is_array($array['ids']) {
$idsArray = $array['ids'];
var_dump($idsArray); // that is the array you need
} else {
die('Data format error');
}