I have this array.
$urls = array(
'0'=>'http://www.domain.com/media1.mp3'
'1'=>'http://www.domain.com/media2.mp3'
'2'=>'http://www.domain.com/media3.mp3'
)
I wan to download these files simultaneously with the help of PHP.
How do I do that? Any suggestions?
I have tried putting headers in for loop but what it does is it combines the content of all files in one big mp3 file.
This is what I tried:
foreach($urls as $url)
{
ob_start();
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=".basename($url));
header("Content-Type: audio/mpeg");
header("Content-Transfer-Encoding: binary");
print file_get_contents($url);
ob_clean();
ob_flush();
flush();
sleep(1);
}
Thanks Vishal