|
<?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, '未查詢到網(wǎng)站信息' )) {
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>網(wǎng)站名稱:</strong>', '', $info );
$info = str_replace ( '<li><strong>網(wǎng)站首頁地址:</strong>', ' ', $info );
$info = str_replace ( '<li><strong>主辦單位名稱:</strong>', ' ', $info );
$info = str_replace ( '<li><strong>主辦單位性質(zhì):</strong>', ' ', $info );
$info = str_replace ( '<li><strong>審核時(shí)間:</strong>', ' ', $info );
$info = str_replace ( '<li><strong>網(wǎng)站備案/許可證號(hào):</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 );
php技術(shù):php實(shí)現(xiàn)的獲取網(wǎng)站備案信息查詢代碼(360),轉(zhuǎn)載需保留來源!
鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。