<?php
/*
???? ??: domain']))?$_GET['domain']:$_POST['domain'];
if(empty($domain)) echo '?? ??? ??? ??? ? ????.';
$count = baiduSL ( $domain);
if(!isset($count)) showjson(array('code'=>200502,'msg '=>'?? ??, ?? ?????!')));
if (!$count) $count = 0;
$result=array(
'code'=>1,
'??? '=>$domain,
'data'=>$count
);
print_r(json_encode($result));
unset($domain,$result,$ch);
?? baiduSL($domain) {
$baidu='https://www.baidu.com/s?ie=utf-8&tn=baidu&wd=site%3A'.$domain
$bdsite=BD_curl($baidu );
$bdsite = str_replace(array("rn", "r", "n", ''), '', $bdsite)
if (!$count) preg_match('/?? ?? ? ?? ??? (.*?)/i',$bdsite,$count);
$baiduSL=strip_tags($count[1])
unset($count);
return $baiduSL;
}
function BD_curl($url){
$ch =curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (iPhone; CPU iPhone Mac OS X? ???? OS 9_1) AppleWebKit/601.1.46(KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$ret = cur_exec($ ch);
curl_close($ch);
return $ret;
}
?>