Answer the question
In order to leave comments, you need to log in
Why is Yii2 loop not working?
Good afternoon, please advise me on this issue. I am using the http client functions of Yii2 batchSend. To limit the number of requests at a time, I made a cycle of such a plan
$perRequest = 150;
$data = [];
for($i = 0; $i < count($urls); $i += $perRequest) {
$current = array_slice($urls, $i, $perRequest);
$data= $client->batchSend($current);
}
$data[$i] = $client->batchSend($current);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question