首页  >  文章  >  后端开发  >  php实现ping

php实现ping

高洛峰
高洛峰原创
2016-12-02 10:23:291445浏览

<?php
// created by joe lumbroso 
// see some other good php3 scripts 
// goto http://www.dtheatre.com/scripts
echo &#39;<font color=\&#39;red\&#39;><blink><b>Pinging</b></blink></font><br>&#39;; 
$to_ping = &#39;dtheatre.com&#39;; 
$count = 3; 
$psize = 65; 
echo &#39; Please be patient, this can take a few moments...\n<br><br>&#39;; 
flush();
while (1) { 
?> 
<pre class="brush:php;toolbar:false"> 
<? 
exec(&#39;ping -c $count -s $psize $to_ping&#39;, $list); 
for ($i=0;$i < count($list);$i ) { 
print $list[$i].&#39;\n&#39;; 
} 
?> 


声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn