次のコードで問題が発生しています。誰か解決できますか? ここに私のコードの説明があります:
$friends=get_data(https://graph.facebook.com/".$facbookid."/friends?access_token=".Useraccess_token);
以下は get_data 関数で、適切なデータを返します。
function get_data($url) {
$ch = curl_init();
$timeout = 5;
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
次に、JSON サービスを使用しました。
$json = new Services_JSON();
$friends = $json->decode($friends);
echo "print data".$friends->data;
if (isset($friends->data))
{
foreach($friends->data as $friend)
{
$i++;
$friendList[] = $friend->id;
}
}
問題は、友達が 1000 人しかいない場合、データを取得することです。ただし、フレンドが 1000 人を超えると機能しません。
実際、私は$friends = $json->decode($friends,true);
などを使用しました。誰か助けてもらえますか?