码迷,mamicode.com
首页 > 微信 > 详细

微信域名检测,PHP随机获取微信能正常访问的域名

时间:2017-06-25 13:18:20      阅读:484      评论:0      收藏:0      [点我收藏+]

标签:and   targe   count   init   etop   blank   help   tps   class   

用户名和KEY请到www.weixin139.com获取

<?php
$url = "https://api.weixin139.com/weixin/domain/auto_check_list?user=xxx&key=xxx&type=1";
$con = get_msg($url);
$data = json_decode($con,true);
$count = count($data)-1;
$rand = rand(0,$count);
echo $data[$rand][‘domain‘];




function get_msg($url){
        $ch = curl_init();
        curl_setopt($ch,CURLOPT_TIMEOUT,1);
        curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch,CURLOPT_URL,$url);
        curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
        curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,false);
        $data = curl_exec($ch);
        if($data){
            curl_close($ch);
            return $data;
        }else {
            $error = curl_errno($ch);
            curl_close($ch);
            return false;
    }
}

来源:http://www.weixin139.com/api_help.html

微信域名检测,PHP随机获取微信能正常访问的域名

标签:and   targe   count   init   etop   blank   help   tps   class   

原文地址:http://www.cnblogs.com/weixin139/p/7076548.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!