- 博客(0)
- 资源 (8)
空空如也
微信开发php关键模块代码
//获取所有用户fakeid
public function getUserFakeid(){
ini_set('max_execution_time',600);
$pageSize = 1000000;
$this->referer = "https://mp.weixin.qq.com/cgi-bin/home?t=home/index&lang=zh_CN&token={$_SESSION['token']}";
$url = "https://mp.weixin.qq.com/cgi-bin/contactmanage?t=user/index&pagesize={$pageSize}&pageidx=0&type=0&groupid=0&token={$this->token}&lang=zh_CN";
$user = $this->vget($url);
$preg = "/\"id\":(\d+),\"name\"/";
preg_match_all($preg,$user,$b);
$i = 0;
foreach($b[1] as $v){
$url = 'https://mp.weixin.qq.com/cgi-bin/contactmanage?t=user/index&pagesize='.$pageSize.'&pageidx=0&type=0&groupid='.$v.'&token='.$this->token.'&lang=zh_CN';
$user = $this->vget($url);
//echo $url . "<br>";
$preg = "/\"id\":(\d+),\"nick_name\":\"(.*?)\",\"remark_name/";
preg_match_all($preg,$user,$a);
for( $j=0; $j<count($a[1]); $j++)
{
//echo $a[1][$i] . $a[2][$i] . "<br>";
$arr[$i]['fakeid'] = $a[1][$j];
$arr[$i]['fakename'] = $a[2][$j];
$arr[$i]['groupid'] = $v;
$i++;
}
}
return $arr;
}
2013-11-29
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人