php根据appid和secret获取微信access_token,php通过curl远程获取微信access_token信息
淘建站为您提供更多_函数_微信,在此特别感谢您对我们的支持与厚爱!
$appid = 'wx422126b0b6bbfcfc';
$secret = '***';
$url = "http://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" . $appid . "&secret=" . $secret . "";
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
curl_close($ch);
print_r(json_decode($result, true));

