Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php ping time

<?php
$ip_address = '123.456.789.0'; // IP address you'd like to ping.
exec("ping -c 1 " . $ip_address . " | head -n 2 | tail -n 1 | awk '{print $7}'", $ping_time);
print $ping_time[0]; // First item in array, since exec returns an array.
?>
Source by www.jeffgeerling.com #
 
PREVIOUS NEXT
Tagged: #php #ping #time
ADD COMMENT
Topic
Name
9+9 =