当前位置:编程学习 > php >>

php实现ping (转)

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

上一个:一种高效的分页机制,设想阶段,大家快来大讨论拉,欢迎批判
下一个:变量的活动范围

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,