PHP code example of zzx / wechat_user

1. Go to this page and download the library: Download zzx/wechat_user 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/ */

    

zzx / wechat_user example snippets


public function __construct($config = null)
    {
        parent::__construct();
        $config['appid'] = '你的appid';
        $config['appsecret'] = '你的appsecret';
        $this->WxMethod = new WxMethod($config['appid'],$config['appsecret']);
        $this->config = $config;
    }

    public function getAccessToken()
    {
        $this->WxMethod->getAccessToken();
    }