手机
当前位置:查字典教程网 >编程开发 >php教程 >php实现的获取网站备案信息查询代码(360)
php实现的获取网站备案信息查询代码(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 ( "rn", '', $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 );

【php实现的获取网站备案信息查询代码(360)】相关文章:

php实现递归抓取网页类实例

php实现首页自动选择语言转跳

php获取系统变量方法小结

php实现根据IP地址获取其所在省市的方法

PHP使用CURL实现多线程抓取网页

无数据库的详细域名查询程序PHP版(3)

递归实现php数组转xml的代码分享

我的论坛源代码(六)

php 批量查询搜狗sogou代码分享

一段php加密解密的代码

精品推荐
分类导航