0
I have a query in sql returning 2399 records, I divide and run it by parts, I need to find a way to divide the loop equally, because if I divide by 100 example, it still remains a 99 loop.
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);
}
}
Explain better what you want, because it seems that the problem is different and should not even be doing this.
– Maniero