php实现的获取网站备案信息查询代码(360)
更新时间:2013年09月23日 17:50:14 作者:
有时候我们需要获取网站备案信息,那么就可以用这个小偷程序,获取了,信息从360抓取
复制代码 代码如下:
<?php
// WebSite http://www.micxp.com
function miibeian($domain) {
$domain = base64_encode ( $domain );
$opts = array (
'http' => array (
'method' => "GET",
'timeout' => 5
)
);
$context = stream_context_create ( $opts );
$url = 'http://webid.360.cn/complaininfo.php?domain=' . $domain;
$html = file_get_contents ( $url, false, $context );
if (strpos ( $html, '未查询到网站信息' )) {
return false;
}
$flag = '<ul>';
$start = strpos ( $html, $flag ) + strlen ( $flag );
$info = substr ( $html, $start, strpos ( $html, '</ul>' ) - $start );
$info = str_replace ( ' ', '', $info );
$info = str_replace ( '<li><strong>网站名称:</strong>', '', $info );
$info = str_replace ( '<li><strong>网站首页地址:</strong>', ' ', $info );
$info = str_replace ( '<li><strong>主办单位名称:</strong>', ' ', $info );
$info = str_replace ( '<li><strong>主办单位性质:</strong>', ' ', $info );
$info = str_replace ( '<li><strong>审核时间:</strong>', ' ', $info );
$info = str_replace ( '<li><strong>网站备案/许可证号:</strong>', ' ', $info );
$info = str_replace ( "\r\n", '', $info );
$info = str_replace ( '</li>', '', $info );
$info = trim ( $info );
$temp = explode ( ' ', $info );
return $temp;
}
// http://webid.360.cn/complaininfo.php?domain=c3lzeXVuLmNvbQ==
$result = miibeian ( 'jb51.net' );
print_r ( $result );
相关文章
Laravel5.4简单实现app接口Api Token认证方法
这篇文章主要介绍了Laravel5.4简单实现app接口Api Token认证,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧2019-08-08
Yii2使用小技巧之通过 Composer 添加 FontAwesome 字体资源
前天帮同事改个十年前的网站 bug,页面上一堆 include require 不禁让人抱头痛哭。看到 V2EX 上的讨论说,写 PHP 不用框架等同于耍流氓。Yii Framework 是我使用了 2 年多的 PHP 框架,器大活好,皮实耐操。 Yii2 还在 Beta 中,不过不影响拿来预研。2014-06-06


最新评论