php微信开发,获取微信公众号登录code 测试代码
                            super                        
                        
                            2024-04-09 16:24                        
                         2236
                            2236
                        <?php
$appId="appid";
$redirectUrl=urlencode('https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
if($_GET['code']){
    echo $_GET['code'];
    echo "<a href='?code='>重新获取</a>";
    exit;
}
Header('Location: https://open.weixin.qq.com/connect/oauth2/authorize?appid='.$appId.'&redirect_uri='.$redirectUrl.'&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect');0 条讨论 
                                 
            