如何使此脚本与多线程一起使用?已经尝试了所有教程但没有成功:( 我可以使用 curl php 的最大线程数是多少?
<?php $imput = file("$argv[1]"); $output = $argv[2]; foreach ($imput as $nr => $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; } ?>