调用方式说明:
GET提交,name值就是你要查询的域名。
PHP源代码:
<?php
$res = @$_GET['name'];
if(strstr($res,"."))
{
$json = file_get_contents('http://icp.chinaz.com/'.$res); //调用的站长工具
function GetBetween($content,$start,$end){
$r = explode($start, $content);
if (isset($r[1])){
$r = explode($end, $r[1]);
return $r[0];
}
return '';
}
// 获取主办单位名称
$b ='主办单位名称
';
$c ='<';
$name = GetBetween($json,$b,$c);
// 获取性质
$b ='主办单位性质
'; '; '; '; ';
$c ='<';
$nature = GetBetween($json,$b,$c);
// 获取备案号
$b ='网站备案/许可证号
$c ='<';
$icp = GetBetween($json,$b,$c);
// 获取网站名称
$b ='网站名称
$c ='<';
$sitename = GetBetween($json,$b,$c);
// 获取网站首页地址
$b ='网站首页网址
$c ='<';
$index = GetBetween($json,$b,$c);
if(strstr($index,"."))
{ }else{
echo "
exit();
}
// 获取审核时间
$b ='审核时间
$c ='<';
$time = GetBetween($json,$b,$c);
echo '<!DOCTYPE html>
序号 | 主办单位名称 | 主办单位性质 | 网站备案/许可证号 | 网站名称 | 网站首页网址 | 审核时间 | 是否限制接入 | 详细信息 |
---|---|---|---|---|---|---|---|---|
1 |
'. $name.'
|
'. $nature.'
|
'. $icp.' | '.$sitename.' |
'.$time.'
|
否 | 详细信息 |
';
}else{
echo "
// echo "内容不为空";
// return false;
exit();
}
?>
如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!
txttool.com 说一段 esp56物联 查询128 IP查询