title: How can I use php curl with multi threads?
body: <p>How can I make this script work with multi threads?
  Already tried all tutorials but without success :(
  And what is the maximum number threads I can use with curl php?</p>
  
  <blockquote>
  <pre><code>&lt;?php
  $imput  = file("$argv[1]");
  $output = $argv[2];
  
  
  foreach ($imput as $nr =&gt; $line) {
  $line = trim($line);
  print ("$nr - check :" . $line . "\r\n");
  
  $check = ia_continutul($line); 
  
  if (strpos($check,'wordpress') !== false) {
  
    $SaveFile = fopen($output, "a");
    fwrite($SaveFile, "$line\r\n");
    fclose($SaveFile);
    }
  }
  print "The END !\r\n";
  
  function ia_continutul($url) {  
      $ch = curl_init();  
      $timeout = 3;  
      curl_setopt($ch,CURLOPT_URL,$url);  
      curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);  
      curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
    curl_setopt($ch, CURLOPT_TIMEOUT, 5);  
      $data = curl_exec($ch);  
      curl_close($ch);  
      return $data;  
  }
  ?&gt;
  </code></pre>
  </blockquote>