У меня возникла проблема с этим, потому что я не могу выполнить резервное копирование. как только я увижу возвращаемую переменную.
Код: Выделить всё
$url = "https://xxxxxxxxxxxxxx.com/process/api/transactions/from/$yesterday/to/$today/for/company/21?offset=0&limit=1000";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Cookie: $cookie"));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
file_put_contents(rj_array, $result, FILE_APPEND);
$server = file_get_contents(rj_array);
$json_result = json_decode($server, true);
$next = $json_result['next'];
Код: Выделить всё
while(!empty($next)){
//Do the curl request again with the new URL $next
}
Подробнее здесь: https://stackoverflow.com/questions/406 ... -available