php ping

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

showing results for - "php ping"
Claudio
18 Mar 2019
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?>
Miguel Ángel
16 Jan 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
similar questions
queries leading to this page
php ping