微信实用函数

IT-Pony 2016-05-16 AM 413℃ 0条
//判断是不是用微信浏览器打开
function is_weixin()
{
    if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false ) return true;
return false;
}
//获取微信access_token;
function AccessToken($appid,$secret)
{
    $url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=$appid&secret=$secret';

    $results = json_decode(file_get_contents($url),true);

    return $results;
}
标签: none

非特殊说明,本博所有文章均为博主原创。

评论啦~