PHP code example of o0x00 / easywechatshare

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

    

o0x00 / easywechatshare example snippets


Server端使用方法

假设该文件访问地址为 http://www.domain.com/share.php

 

=> false,

    /**
     * 账号基本信息,请从微信公众平台/开放平台获取
     */
    'app_id'  => 'xxx',         // AppID
    'secret'  => 'xxxxxx',     // AppSecret
    'token'   => '',          // Token
    'aes_key' => '',         // EncodingAESKey,安全模式与兼容模式下请一定要填写!!!
    'log' => [
        'level' => 'debug',
        'file'  => '/tmp/m/easywechat.log', // XXX: 绝对路径!!!!
    ],
];

$config = [
    'onMenuShareAppMessage', 
    'onMenuShareTimeline', 
    'onMenuShareQQ', 
    'onMenuShareWeibo', 
    'onMenuShareQZone'
];

$Application = new Application($options);
$Share = new Share($Application);

echo $Share->getConfig($config);