
In this tutorial, you will learn how to test/detect your internet connection speed using the latest PHP version.
First of all, create a new PHP file index.php and add the following code to it. After that open this file using a server like Apache, Nginx, etc. As you probably want to test this script in a development environment so I would recommend you to use XAMPP.
<?php
$kb = 1024;
echo "Streaming $kb Kb...<!-";
flush();
$time = explode(" ",microtime());
$start = $time[0] + $time[1];
for($x = 0; $x < $kb; $x++)
{
echo str_pad('', 1024, '.');
flush();
}
$time = explode(" ",microtime());
$finish = $time[0] + $time[1];
$deltat = $finish - $start;
echo "-><br />Test finished in $deltat seconds<br />";
echo "Your internet speed is ". round($kb / $deltat, 3)."Kb/s";
?>$kb and set its value to 1024. Basically, we will use this variable in a for loop to specify the number of iterations.microtime() function at the start and end of the for loop to track the start/end time of the loop.$deltat that will hold the value of “loop finish time” minus “loop start time”. It means that this variable will tell us how much time was taken by the for loop to finish.$kb variable with $deltat and rounding the value to 3 decimal places using the round() function.Google Chrome has dominated web browsing for over a decade with 71.77% global market share.…
Perplexity just made its AI-powered browser, Comet, completely free for everyone on October 2, 2025.…
You've probably heard about ChatGPT Atlas, OpenAI's new AI-powered browser that launched on October 21,…
Perplexity Comet became free for everyone on October 2, 2025, bringing research-focused AI browsing to…
ChatGPT Atlas launched on October 21, 2025, but it's only available on macOS. If you're…
Two AI browsers just entered the ring in October 2025, and they're both fighting for…