Is there a php script/snippets out there that allows you to check a URL/IP for connection speed. Say example the URL is www.example.com and when I run the php script it will display how long it took to connect (211ms) to the URL/IP, I found some scripts that just show me if it's online or offline but not the speed it took.
I'm very aware of the free and paid services. I want create my own custom/private one to monitor my many servers and having trouble finding a simple script to connect to given locations.
Maybe something like:
<?php
// Create a curl handle
$ch = curl_init('http://www.yahoo.com/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Execute
curl_exec($ch);
// Check if any error occured
if(!curl_errno($ch)) {
$info = curl_getinfo($ch);
echo 'Took ' . $info['total_time'] . ' seconds to send a request to ' . $info['url'];
}
// Close handle
curl_close($ch);
?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With