#微信公众平台开发模式通用接口API新版
- PHP >= 5.5
- Composer
$ composer require "handsomegyr/wechat" -vvv
基本使用(以服务端为例):
<?php
$client = new \Weixin\Client();
$client->setAccessToken($access_token);
echo "<br/>将一条长链接转成短链接接口<br/>";
$long_url = 'http://www.baidu.com/?a=1&b=2&c=3';
$ret = $client->getShortUrlManager()->long2short($long_url);
print_r($ret);
MIT