php实现ping功能


PHP #ping2012-10-28 22:52

以下是相关实现代码:

01<?php
03 
04echo "<font color="red"><blink><b>Pinging</b></blink></font><br>";
05$to_ping = "yige.org";
06$count = 3;
07$psize = 65;
08echo " Please be patient, this can take a few moments... <br><br>";
09flush();
10 
11while (1) {
12?>
13<pre>
14<?
15exec("ping -c $count -s $psize $to_ping", $list);
16for ($i=0;$i < count($list);$i++) {
17print $list[$i]." ";
18}
19?>
20</pre>
21<?
22flush();
23sleep(3);
24}
25?>


相关文章

粤ICP备11097351号-1