PHP code example of xupp / wechat

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

    

xupp / wechat example snippets



use wechat\Wx;
$config = [
  'token' => 'weixin',
  'appId' => 'wx917fc314c6f429ff',
  'appSecret' => 'e7d5c0c720bb9cbd7248bf602b3f17b3'
];     
$wx = new Wx($config);
$wx->valid();
$message = $wx->instance('message');
if($message->isTextMsg()){
    $message->text('我的微信sdk发布了');
}