标签:
private function getAccessToken() { $memcache_obj = memcache_connect("localhost", 11211); $access_token=$memcache_obj->get(‘access_token‘); if(!$access_token){ $url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=$this->appId&secret=$this->appSecret"; $res = json_decode($this->httpGet($url)); $access_token = $res->access_token; if ($access_token) { $memcache_obj->set(‘access_token‘, $ticket, false, 7000); } } return $access_token; }
标签:
原文地址:http://www.cnblogs.com/yutaoyao/p/4273874.html