获取微信access_token

/**
* 获取微信access_token
* @return mixed
*/
function get_access_token() {
$appId = C('APPID');
$secret = C('APPSECRET');
$access_token = '';
$url_token = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=".$appId."&secret=".$secret;
$str_json_access_token = curl_get($url_token);
if(!empty($str_json_access_token)){
$array_json_access_token = json_decode($str_json_access_token,true);
$access_token = $array_json_access_token['access_token'];
}
return $access_token;
}
上一篇:MySQL更新命令_UPDATE


下一篇:在 Virtual Box 中为 CentOS7 mini 配置双网卡