I want to set the bandwidth to the webpages using php.
I got some php code to set the bandwidth for downloading files but i want to set the bandwidth to the web pages.
Is it possible to set the bandwidth to the web pages using php?
If possible, please give me the sample code or working link for reference.
The below code is to sent the bandwidth for downloading files
set_time_limit(0);
$filedownload = "files/abc.exe";
$time = 10000;
$obytes = 150*1024; //150k download speed restriction
$fd = fopen ($filedownload, "rb");
while (!feof ($fd)) {
list($usec, $sec) = explode(" ", microtime());
$time_start = $usec + $sec;
$bytes = ceil($obytes/100);
echo fread($fd, $bytes);
flush();
if($time < 10000) usleep(10000-$time);
$i++;
list($usec, $sec) = explode(" ", microtime());
$time_end = $usec + $sec;
$time =ceil(($time_end - $time_start)*1000000)+10;
}
fclose ($fd);