微擎使用函数获取用户微信信息

 $_accounts = $accounts = uni_accounts();
        
        load()->model('mc');
        if (empty($accounts) || !is_array($accounts) || count($accounts) == 0) {
            message('请指定公众号');
        }
        if (!isset($_GPC['acid'])) {
            $account = array_shift($_accounts);
            if ($account !== false) {
                $acid = intval($account['acid']);
            }
        } else {
            $acid = intval($_GPC['acid']);
            if (!empty($acid) && !empty($accounts[$acid])) {
                $account = $accounts[$acid];
            }
        }
        reset($accounts);
        //上面赋值进来的

        //$aa=array();
        if ($row['openid']) {//有openid就查询用户信息
            //foreach ($list as $index => $row) {
            $row['user']= mc_fansinfo($row['openid'], $acid, $_W['uniacid']);
        
            # code...
        }

  

原文地址:https://www.cnblogs.com/weiyiyong/p/7610731.html