获取QQ昵称和头像PHP源码

<?php
header("Access-Control-Allow-Origin:*");
header('Content-type: application/json');
$id = $_GET['qq'];
$get_info = file_get_contents('https://api.unipay.qq.com/v1/r/1450000186/wechat_query?cmd=1&pf=mds_storeopen_qb-__mds_qqclub_tab_-html5&pfkey=pfkey&from_h5=1&from_https=1&openid=openid&openkey=openkey&session_id=hy_gameid&session_type=st_dummy&qq_appid=&offerId=1450000186&sandbox=&provide_uin=' . $id);
$names = json_decode($get_info, true);
if(!isset($names['nick'])) return false;
$name = urldecode($names['nick']);
$txurl = 'https://q2.qlogo.cn/headimg_dl?dst_uin='.$id.'&spec=100';
$info = array('code' => '200','qq' => $id,'imgurl' =>$txurl,'name' => $name,);
echo json_encode($info,320);
?>

0

评论0

请先

没有账号? 注册  忘记密码?

社交账号快速登录