function fz_json_api_get($results) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_URL, $results);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
$result = curl_exec($ch);
curl_close($ch);
$result = json_decode($result, true);
if(empty($result)){
echo 'Problem in getting feed data';
return ;
}
return $result;
}
这个功能运作良好,但在第15页后停在中间,错误不在json中,因为它在浏览器上打开了。