Curl有时不会执行所有命令

时间:2013-04-12 15:27:20

标签: php curl

Winging卷曲代码,我有很多preg_match_all();并获取一些数据和网址。有时它会处理所有这些,有时会错过某些部分。

是否有任何功能让它等到所有卷曲完成或加速过程?

$ch = curl_init();

curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST, count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); 
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); 
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path);   // Cookie management.
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path); 

$result = curl_exec($ch);

curl_close($ch); 

// Step3. parsing username
preg_match_all("#<span id=\"class\" class=\"tall\">(.*?)</span>#si", $result, $match);

并且得到了很多 那里有preg_match_all个命令

0 个答案:

没有答案