Record, reserve later
<? php $ host = 'www.google.com'; // address to ping, or IP $ port = '80'; // port to ping $ num = 3; function microtime_float () {list ( $ usec, $ sec) = explode ("", microtime ()); return ((float) $ usec + (float) $ sec);} function ping ($ host, $ port) {$ time_start = microtime_float $ ip = gethostbyname ($ host); $ fp = @fsockopen ($ host, $ port, & $ errno, & $ errstr, 1); if (! $ fp) return 'replay time out!'; $ get = " $ Time. $ Time_end - $ time_start ($ fp); $ time_end = microtime_float (); $ time = $ time_end - $ time_start $ time = ceil ($ time * 1000); return 'Reply from'. $ ip. ': time ='. $ time.'ms <br /> ';} echo' Pinging '. $ host.' [' .gethostbyname ($ host). '] with Port:'. $ port. 'of data: <br /> <br />'. "rn"; for ($ i = 0; $ i <$ num; $ i ++ ) {ping ($ host, $ port); sleep (1); ob_flush (); flush ();}?>