|
<br> <? <BR>function get_status($uin) <BR>{ <BR>$fp = @fsockopen ("infocenter.tencent.com", 80, &$errno, &$errstr, 30); <BR>if(!$fp)<BR>{ <BR>return '出错'; <BR>} <BR>else <BR>{ <BR>fputs($fp, "GET /$uin/l/00/0/ HTTP/1.0 "); <BR>$do = 'yes'; <BR>while(!feof($fp)) <BR>{ <BR>$line = fgets ($fp,128); <BR>$do = ($do == 'yes')?'yes' eregi("^GIF89", $line))?'yes':'no'; <BR>if($do == 'yes') <BR>{ <BR>if(ereg("Online", $line)) <BR>{ <BR>return '在线'; <BR>} <BR>elseif(ereg("Offline", $line)) <BR>{ <BR>return '没在线'; <BR>} <BR>} <BR><BR>} <BR>fclose($fp); <BR>} <BR>return '未知'; <BR>} <BR>$uin='1697313'; //我自己的 <BR>echo get_status($uin); <BR>?> <br><br> |
|