Parallel CURL function Help .. php
Posted
by Webby
on Stack Overflow
See other posts from Stack Overflow
or by Webby
Published on 2010-06-01T00:01:26Z
Indexed on
2010/06/01
0:03 UTC
Read the original article
Hit count: 261
Hello..
Firstly let me explain the code below is just a tiny snippet of the code I'm using on the working site.
Basically I'm hoping someone can help me rewrite just the function below to enable parallel CURL calls... that way it will fit nicely into the existing code without me having to rewrite the whole from the ground up like some of the samples I've been finding today
any ideas?
function get_data($url) { $ch = curl_init(); $timeout = 5; curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,5); $data = curl_exec($ch); curl_close($ch); return $data; }
p.s. $url goes through a huge bunch of urls in a loop already so I'd hole to keep that intact..
Help always appreciated and rewarded
© Stack Overflow or respective owner