Question about fsockopen
Posted: Wed Jun 26, 2002 9:00 pm
Hi, in another thread, romeo post something like this
Now, i was wondering...is there a posibility to open several fsockopen to download several files, in the same script?
I know i can download all files on a page, but one by one is kinda slow...and downloading 4 or 5 files at time will improve the speed of the script
Code: Select all
<?php
$fp = fsockopen ("www.example.com", 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
fputs ($fp, "GET / HTTP/1.0\r\nHost: www.example.com/tough.zip");
while (!feof($fp)) {
echo fgets ($fp,128);
}
fclose ($fp);
}
?>I know i can download all files on a page, but one by one is kinda slow...and downloading 4 or 5 files at time will improve the speed of the script