<?php
header('content-type:text/html;charset=utf-8');
define("ViaGe_Weixin_Access_Token",str_replace('\\','/',dirname(__FILE__)));//根目录物理路径
//配置APPID、APPSECRET
$appid = "APPID";
$secret = "APPSECRET";
$qrcode=_qrcode("1",$appid,$secret,"258");
echo '<img src="./'.$qrcode['img'].'" >';
//获取access_token
function access_token($appid,$secret){
$access_token = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=$appid&secret=$secret";
$access_path = ViaGe_Weixin_Access_Token."/" . $appid . ".json";
$file = file_get_contents($access_path, true);
$access = json_decode($file, true);
if (time() > $access['expires']) {
$get_access_token = Roboa_Url($access_token);
$get_access_token = json_decode($get_acce
自定义小程序带参数获取方形和圆形二维码
最新推荐文章于 2024-08-28 11:19:32 发布
本文介绍如何在微信小程序中实现自定义参数的方形和圆形二维码生成,结合后端PHP服务,详细讲解了从接口设计到前端调用的全过程。
摘要由CSDN通过智能技术生成