多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
``` ~~~ /** * @param $qq * @return array * @date: 2020/3/26 * @name: getQQ * @describe: 获取QQ信息 */ public static function getQQ($qq){ $returnArr = ['code' => 0, 'msg' => '获取失败']; if (!$qq || !preg_match('|^[1-9]\d{4,10}$|i', $qq)) { $returnArr['msg'] = 'QQ格式错误'; return $returnArr; } $nickname = file_get_contents('https://r.qzone.qq.com/fcg-bin/cgi_get_portrait.fcg?g_tk=1518561325&uins=' . $qq); $image = 'http://q.qlogo.cn/headimg_dl?dst_uin=' . $qq . '&spec=100'; if (strstr($nickname, 'portraitCallBack')) { $name = trim(mb_convert_encoding($nickname, "UTF-8", "GBK"), 'portraitCallBack()'); $name = json_decode($name, true); if (isset($name[$qq][6]) && !empty($name[$qq][6])) { $name = $name[$qq][6]; } else { $name = '游客'; } $returnArr = array('code' => 1, 'msg' => '成功', 'image' => $image, 'name' => $name, 'qq' => $qq); } else if (strstr($nickname, '_Callback')) { $returnArr['msg'] = '获取昵称失败'; } return $returnArr; } ~~~ ```