冰豆网

分享网络精彩
bingdou.com.cn

获取QQ昵称和头像PHP源码

时间:2020-09-01加入收藏

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

打 赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

TGA: php 技巧

分享到:


官方微信二维码冰豆网官方微信公众号