Rabbits.

PHP获取QQ信息和头像
<?php if ($_GET['qq']) { $qq = $_GET['qq'] $get_info =...
扫描右侧二维码阅读全文
02
2018/09

PHP获取QQ信息和头像

嘿嘿嘿

<?php
if ($_GET['qq']) {
$qq = $_GET['qq']
$get_info = file_get_contents('http://r.qzone.qq.com/fcg-bin/cgi_get_portrait.fcg?
get_nick=1&uins='.$qq);
$get_info = mb_convert_encoding($get_info, "UTF-8", "GBK");
$name = json_decode(substr($get_info,17,-1),true);
if($name and $qq){ 
    $txUrl = 'https://q.qlogo.cn/headimg_dl?dst_uin='.$qq.'&spec=100';
    $arr = array(
        'code' => 1,
        'imgurl' => $txUrl,
        'name' => urlencode($name[$qq][6])
    );
  exit(stripslashes(urldecode(json_encode($arr))));
 }else{
$arr = array(
    'code' => -1,
    'msg' => 'Error'
);
exit(stripslashes(urldecode(json_encode($arr))));
}
}else{
$arr = array(
    'code' => -1,
    'msg' => 'Error'
);
exit(stripslashes(urldecode(json_encode($arr))));
}
?>

如何调用?

调用地址:www.xxxx.com/xx.php?qq=QQ号
Last modification:January 12th, 2019 at 12:54 pm
如果觉得我的文章对你有用,请随意赞赏 |´・ω・)ノ

Leave a Comment