微信获取临时二维码ticket

<?php

 

$url = "http://helloiuh.applinzi.com/get_token.php";
$access_token = file_get_contents($url);

 

$jsonmenu = ‘{"expire_seconds": 604, "action_name": "QR_SCENE", "action_info": {"scene": {"scene_id": 44444}}}‘;

 

 

$url = "https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=".$access_token;

$result = https_request($url, $jsonmenu);

var_dump($result);

 

function https_request($url,$data = null){

$curl = curl_init();

curl_setopt($curl, CURLOPT_URL, $url);

curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);

curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);

if (!empty($data)){

curl_setopt($curl, CURLOPT_POST, 1);

curl_setopt($curl, CURLOPT_POSTFIELDS, $data);

}

curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

$output = curl_exec($curl);

curl_close($curl);

return $output;

}

 

?>

 

微信获取临时二维码ticket

上一篇:Magcodes.WeiChat——自定义CustomCreationConverter之实现微信自定义菜单的序列化


下一篇:NodeJs 开发微信公众号(四)微信网页授权