PHP检测qq在线状态

2014-04-22 22:40
    <?php
    $qqStr = '781787584:291277891:781787584:1585887008:10086:1035334740:8043198';
    $qqArr = explode ( ':', $qqStr );
    $qqArr = array_unique ( $qqArr );
    sort ( $qqArr );
    $qqStr = implode ( ':', $qqArr );
    $url = 'http://webpresence.qq.com/getonline?Type=1&' . $qqStr . ':';
    $html = file_get_contents ( $url );
    $Arr = explode ( ']=', $html );
    $count = count ( $Arr );
    for($i = 1; $i < $count; $i ++) {
        $result [$qqArr [$i - 1]] = substr ( $Arr [$i], 0, 1 );
    }
    print_r ( $result );
    exit ();
^