PHP code example of firstphp / firstphp-wxapp

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

    

firstphp / firstphp-wxapp example snippets


WXAPP_APPID=wxda93db123lafdu83d
WXAPP_APPSECRET=87afeef9df90b74g4a8l9ca8d67b5742
WXAPP_KEY=mWm1DkAVBAZD2L5rs3QWKeoWa62wLumjqCXG9HifLdM
WXAPP_URL=https://api.weixin.qq.com/

use Firstphp\FirstphpWxapp\WxappInterface;

......

/**
 * @Inject
 * @var WxappInterface
 */
protected $wxappInterface;

public function test() {
    $res = $this->wxappInterface->getAccessToken();
    var_dump($res);
}