php ping time

Solutions on MaxInterview for php ping time by the best coders in the world

showing results for - "php ping time"
Ariana
21 Sep 2017
1<?php
2$ip_address = '123.456.789.0'; // IP address you'd like to ping.
3exec("ping -c 1 " . $ip_address . " | head -n 2 | tail -n 1 | awk '{print $7}'", $ping_time);
4print $ping_time[0]; // First item in array, since exec returns an array.
5?>
Hannes
02 Nov 2017
1exec("ping ".$ip, $output, $status);
2// $ip: desired ip address
3// $output: result messages from the ping
4// $status: result status code from the ping
5//		0: success
6//		1: no response
7//		2: other errors