网络编程 
首页 > 网络编程 > 浏览文章

php实现ping

(编辑:jimmy 日期: 2024/11/18 浏览:3 次 )

<?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);
}
?> (出处:Viphot)
上一篇:用PHP调用数据库的存贮过程
下一篇:PHP也可以當成Shell Script