推荐教程

  • 没有找到任何内容!
您当前的位置:天域资源网络编程PHP编程 → 教程内容

php实现ping

  • 作者:佚名    来源:不详    发布时间:2004-6-17 14:37:00
  • 字体大小:

<?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);
}
?>