1、openidusers.php
<?php
//set_time_limit(600);
set_time_limit(0);
header("Content-type: text/html; charset=utf-8");
session_start();
$opts = array(
'http'=>array(
'method'=>"GET",
'timeout'=>1000,
)
);
$context = stream_context_create($opts);
$gettoken=file_get_contents("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=xxx&secret=8ab524866eba5384cc4f6f4acxxx", false, $context);
$res=json_decode($gettoken,true);
$token=$res["access_token"];
$_SESSION["token"]=$token;
$getopenid=file_get_contents("https://api.weixin.qq.com/cgi-bin/user/get?access_token={$token}&next_openid=", false, $context);
$res2=json_decode($getopenid,true);
$openid=$res2['data']['openid'];
foreach($openid as $k=>$v){
$getuser=file_get_c