我今天把阿修罗这个名号用了,但是我不是为了冒充谁,
我只是单纯的解析了一下这个二级域名,刚好是字母A开始的:A.xiu.no
function qq_login_get_openid_by_token($token) {
$get_openid_url = "https://graph.qq.com/oauth2.0/me?access_token=$token";
$s = https_get($get_openid_url);
if(strpos($s, "callback") !== false) {
$lpos = strpos($s, "(");
$rpos = strrpos($s, ")");
$s = substr($s, $lpos + 1, $rpos - $lpos -1);
}
$arr = xn_json_decode($s);
if (isset($arr['error'])) {
$error = $arr['error'].'<br />'.$arr['error_description'];
return xn_error(-1, $error);
}
return $arr['openid'];
}