卓越飞翔博客卓越飞翔博客

卓越飞翔 - 您值得收藏的技术分享站
技术文章11201本站已运行3223

PHP网站备案查询API接口代码

PHP网站备案查询APIUSB代码,JSON格式回到数据,查询结果如下图,用的值班员工具查询USB二次封装。

PHP网站备案查询APIUSB代码

备案查询API代码

error_reporting(0);
$url = $_GET['url'];
var_dump();
if(!isset($url)){
echo '参数错误!';
die;
}elseif($url==''){
echo '未输入要查询的域名!';
}else{
$str = file_get_contents('http://icp.chinaz.com/'.$url);
$sitenames = getSubstr($str, '

', '>['); preg_match('/(.*?)/',$str,$name); preg_match('/

(.*?)

/',$str,$nature); preg_match('/

(.*?)/',$str,$icp); preg_match('/

(.*?)

/',$sitenames,$sitename); preg_match('/(.*?)

/',$str,$siteindex); $time = getSubstr($str, '审核时间', ' '); //echo $time; preg_match('/

(.*?)

/',$time,$time); if(strpos($str,'未备案或备案取消') == 0){ print_r(json_encode(array('name'=>$name[1],'siteindex'=>$siteindex[1],'nature'=>$nature[1],'icp'=>$icp[1],'sitename'=>$sitename[1],'img'=>'http://icp.chinaz.com'.$icp[2],'time'=>$time[1]),320)); }else{ print_r(json_encode(array('code'=> -1,'msg'=>'未查询到备案!'),320)); } }

激活以上代码帐帖到PHP文件,浏览器运行:您的域名/baian.com?url=https://www.11dz.cn/

卓越飞翔博客
上一篇: Python查询工信部网站备案信息
下一篇: PHP抖音视频无水印解析接口
留言与评论(共有 0 条评论)
   
验证码:
隐藏边栏