Search
 
SCRIPT & CODE EXAMPLE
 

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.
?>
Comment

php ping

exec("ping ".$ip, $output, $status);
// $ip: desired ip address
// $output: result messages from the ping
// $status: result status code from the ping
//		0: success
//		1: no response
//		2: other errors
Comment

PREVIOUS NEXT
Code Example
Php :: laravel npm build production 
Php :: how make custom menu in wordpress 
Php :: add custom style to wordpress editor 
Php :: wpdb get results foreach 
Php :: with message in laravel 
Php :: ternary operator for three conditions in php 
Php :: php Calculate the number of months between two dates 
Php :: laravel set session timeout 
Php :: Class "Controller" not found 
Php :: php group multidimensional array by value 
Php :: Displaying the category name of a custom post type 
Php :: get domain url with https in laravel 
Php :: laravel how to check if there are record exists 
Php :: laravel validation greater than or equal to 
Php :: laravel delete relationship data 
Php :: custom laravel auth 
Php :: title tag wordpress 
Php :: add time to a date php 
Php :: check null in_array php 
Php :: model get last query in php 
Php :: change arabic number to english php 
Php :: drupal 8 twig add id 
Php :: laravel form request validation unique update 
Php :: laravel validation image or file 
Php :: drop column migration laravel 
Php :: instal phpgd2 
Php :: laravel add column to table 
Php :: php error stack overflow 
Php :: fetch method and class in codeigniter 
Php :: php example 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =