微信小程序 後臺 php 獲取access_token

獲取小程序全局唯一後臺接口調用憑據(access_token)。調調用絕大多數後臺接口時都需使用 access_token。

請求地址

GET https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET

<?php
$appid='wxc換成你的3';
$appsecret='68換成你的cd';
$r = file_get_contents("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=$appid&secret=$appsecret");
$data = json_decode($r,true);
echo json_encode($r);

返回值如下:

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章