判断oicq是否在线的php小程序

function get_status($uin) { $fp = @fsockopen (“infocenter.tencent.com”, 80, &$errno, &$errstr, 30); if(!$fp) { return 出错; } else { fputs($fp, “get /$uin/l/00/0/ http/1.0 “); $do = yes; while(!feof($fp)) { $line = fgets ($fp,128); $do = ($do == yes)?yes:(eregi(“^gif89”, $line))?yes:no; if($do == yes) { if(ereg(“online”, $line)) { return 在线; } elseif(ereg(“offline”, $line)) { return 没在线; } } } fclose($fp); } return 未知; } $uin=1697313; //我自己的 echo get_status($uin); ?>

http://www.bkjia.com/phpjc/532160.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/532160.htmltecharticlefunction get_status($uin) { $fp = @fsockopen (“infocenter.tencent.com”, 80, $errstr, 30); if(!$fp) { return 出错; } else { fputs($fp, “get /$uin/l/00/0/ http/1.0 “); $do = yes; w…

Posted in 未分类