php 实现监听服务器

来源:互联网 发布:同步助手备份软件 编辑:程序博客网 时间:2024/06/05 07:08
<?php
header('content-type:text/html;charset=utf-8');
set_time_limit(0);
error_reporting(E_WARNING);
$radius=array(
    '106.187.93.138'=>array('url'=>'https://manager.linode.com/linodes/dashboard/TXVPN_Pro_Radius','urlbefore'=>'https://manager.linode.com/session/index?r=/linodes/dashboard/TXVPN_Pro_Radius'),
    );
function pings($ip,$time) {    exec('ping -n 1 -w '.$time.' '.$ip,$list);    $errorlog=$list[2];    $encode = mb_detect_encoding($errorlog, array("ASCII",'UTF-8',"GB2312","GBK",'BIG5'));      //echo $encode;    $str_encode = mb_convert_encoding($errorlog, 'UTF-8', $encode);     /*echo $str_encode;*/    if('请求超时。' === $str_encode){        return $ip;    }else{        return false;    }}
0 0
原创粉丝点击