Home >Backend Development >PHP Tutorial >A small program to use PHP to determine whether oicq is online_PHP tutorial

A small program to use PHP to determine whether oicq is online_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-13 17:25:32757browse


来源:keniv

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);
?>

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/532035.htmlTechArticle来源:keniv function 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); $d...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn