欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

php实现ping

程序员文章站 2022-04-22 17:06:40
...
<?php
// created by joe lumbroso 
// see some other good php3 scripts 
// goto http://www.dtheatre.com/scripts
echo '<font color=\'red\'><blink><b>Pinging</b></blink></font><br>'; 
$to_ping = 'dtheatre.com'; 
$count = 3; 
$psize = 65; 
echo ' Please be patient, this can take a few moments...\n<br><br>'; 
flush();
while (1) { 
?> 
<pre> 
<? 
exec('ping -c $count -s $psize $to_ping', $list); 
for ($i=0;$i < count($list);$i ) { 
print $list[$i].'\n'; 
} 
?> 
</pre> 
<? 
flush(); 
sleep(3); 
} 
?>
相关标签: php