PHP code example of pgyf / opensdk-wechat

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

    

pgyf / opensdk-wechat example snippets




use Pgyf\Opensdk\Wechat\OpenPlatform\Application;

$config = [
    'app_id' => 'wx3cf0f39249eb0exxx',
    'secret' => 'f1c242f4f28f735d4687abb469072xxx',
    'aes_key' => 'abcdefghijklmnopqrstuvwxyz0123456789ABCDEFG',
    'token' => '',
];

$app = new Application($config);
$app->setCache(new TestCache()); //自己实现一个\Psr\SimpleCache\CacheInterface接口的缓存类