php检测网站的URL地址是否被百度收录(curl模式),其实很简单,不多说了,上代码吧。function checkBaidu($url) { <br>
$url = 'http://www.baidu.com/s?wd=' . urlencode($url); <br>
$curl = curl_init(); <br>
curl_setopt($curl, CURLOPT_URL, $url); <br>
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); <br>
$rs = curl_exec($curl); <br>
curl_close($curl); <br>
if (!strpos($rs, '没有找到')) { //没有找到说明已被百度收录 <br>
return 1; <br>
} else { <br>
return -1; <br>
} <br>
}<br>
$url = 'http://www.sucaihuo.com/js'; <br>
echo checkBaidu($url);
结果显示:已收录
在线检测url百度收录表单:http://www.sucaihuo.com/js/450.html
PHP判断url链接是否被百度收录.zip ( 3 KB 下载:43 次 )
AD:真正免费,域名+虚机+企业邮箱=0元