Good afternoon. The question arose when working with the curl of Ohm: how to send requests in a loop, namely: whether it is necessary to open and close the session on each iteration or it has to be done outside the loop?
// open from outside $curl = curl_init(); foreach ($paramArray as $param) { // or iteration $curl = curl_init(); $url = "http://domain.com/script.php?param=" . $param; curl_setopt_array($curl, array( CURLOPT_RETURNTRANSFER => true, CURLOPT_URL => $url, )); $response = curl_exec($curl); // also close curl_close($curl); } // also close curl_close($curl);