PHP code example of whyly / wechat-miniprogram-sdk

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

    

whyly / wechat-miniprogram-sdk example snippets


   $scribe_msg = $mp->getScribeMsg();
   $rs_scribe = $scribe_msg->send($openid, $template_id, array(
       'character_string1' => array('value' => 'T878772'),
       'name11' => array('value' => '李四'),
       'phone_number12' => array('value' => '13978786576'),
       'thing5' => array('value' => '风扇不转了。')
   ));
   

   $rs_custom = $custom_msg->send($openid, 'text', array(
       'content' => '客服消息测试'
   ));
   

   $custom_msg = $mp->getCustomMsg();
   $rs_upload = $custom_msg->uploadTempMedia('/var/www/logo.png');