PHP code example of kissyuyu7 / qq_auth

1. Go to this page and download the library: Download kissyuyu7/qq_auth library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kissyuyu7 / qq_auth example snippets


$config = [
    'appId'       => '你的APPID',
    'appKey'      => '你的APPKEY',
    'callbackUrl' => '你的授权回调地址'
]; 

use kissyuyu7\QQAuth;
$authObj = new QQAuth($config);

$authObj->getAuthPageUrl('验证字符串[null]','移动端[false]');

$userInfo = $authObj->getUserInfoByAuthCode(回调回来的code);