I have a .php file with following codes. I wanted to make the curl request in parallel because in below code - every request is taking minimum 1 second. I wanted to process at least 10 requests within this time. How can I achieve this?
<?php
$data = file("test.txt", FILE_IGNORE_NEW_LINES);
$count = count($data);
for( $i = 0; $i<$count; $i++)
{
$mob=$data[$i];
$url = "http://127.0.0.1/test.php?category=243&to=$mob";
echo $url."\n";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$htmlText = curl_exec($ch);
curl_close($ch);
}
?>
test.txt
file have some data like below:
100100
200200
300300
......
......
Any help would be highly appreciated.