function get_qq_status($string) {
$ch = curl_init();
$timeout = 10;
curl_setopt ($ch, CURLOPT_URL, "
http://webpresence.qq.com/getonline?type=1&{$string}:");
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$data = curl_exec($ch);
curl_close($ch);
if(!$data) { return 0; }
switch($data) {
case 'online[0]=0;':
echo("off");
break;
case 'online[0]=1;':
echo("on");
break;
}
}
改成这样 本地测试没问题 ,速度也很快,但是放在服务器就不行了,为什么呢!