I have a query in sql returning 2399 records, I divide it and run it by parts, I need to find a way to split the loop equally, because if I divide by 100, it still has a 99 loop remaining. >
for ($i = 1; $i < 2399; $i++) {
$promises[] = $client->postAsync("/localize/1002/consultar", ['form_params' => ['cpf' => $fetch[$i]->cpf]]);
if ($i % 100 == 0) {
//$pr($promises);
//unset($promises);
}
}