php实现ping功能
PHP #ping2012-10-28 22:52
以下是相关实现代码:
01 | <?php |
02 | // http://yige.org/php/ |
03 |
04 | echo "<font color=" red "><blink><b>Pinging</b></blink></font><br>" ; |
05 | $to_ping = "yige.org" ; |
06 | $count = 3; |
07 | $psize = 65; |
08 | echo " Please be patient, this can take a few moments... <br><br>" ; |
09 | flush (); |
10 |
11 | while (1) { |
12 | ?> |
13 | <pre> |
14 | <? |
15 | exec ( "ping -c $count -s $psize $to_ping" , $list ); |
16 | for ( $i =0; $i < count ( $list ); $i ++) { |
17 | print $list [ $i ]. " " ; |
18 | } |
19 | ?> |
20 | </pre> |
21 | <? |
22 | flush (); |
23 | sleep(3); |
24 | } |
25 | ?> |
相关文章
- PHP自定义json_encode函数 2012/10/26
- PHP过滤HTML标签的函数 2012/10/26
- PHP实现discuz安装进度显示 2012/10/23
- PHP分页类 2012/10/23
- php关联数组快速排序 2012/10/21
- php获取数组中重复数据的函数 2012/10/20
- PHP+MYSQL身份验证的方法 2012/10/20
- PHP找不到php_curl.dll的解决方法 2012/10/20
- PHP注入:谈MySql的SQL注入 2012/10/12
- php注入基本步骤 2012/10/11