欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

PHP随机获取未被微信屏蔽的域名(微信域名检测)

程序员文章站 2024-03-13 14:07:15
用户名和key请到获取

用户名和key请到获取

<?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;
 }
}

以上所述是小编给大家介绍的php随机获取未被微信屏蔽的域名(微信域名检测),希望对大家有所帮助