I stumbled upon this, trying to do the same thing myself. I decided that I would add my solution to help anyone who has the same problem in the future. First, I assume that you have an array of your curl handlers as such:
$mh = curl_multi_init();
$requests = array();
foreach ($someArray as $identifier => $url) {
$requests[$identifier] = curl_init($url);
curl_setopt($requests[$identifier], CURLOPT_RETURNTRANSFER, true);
curl_multi_add_handle($mh, $requests[$identifier]);
}
, :
do {
$status = curl_multi_exec($mh, $running);
} while ($status === CURLM_CALL_MULTI_PERFORM || $running);
, :
$returned = array();
foreach ($requests as $identifier => $request) {
$returned[$identifier] = curl_multi_getcontent($request);
curl_multi_remove_handle($mh, $request);
curl_close($request);
}
$returned .