Recently to do a collation of the site, you need to detect which pages are not Baidu search engine included in the relevant adjustments. Because the use of SITE commands to see is really is not to see, think of the use of PHP program to batch processing, research, and found in fact very simple, the following will be the author of the use of PHP to achieve the test page is included in the function of Baidu to share.
Here is the specific code:
<?php
*
* Check whether the Web page is included in Baidu, return 1 is included in the return of 0 said not included
* @ param string $url to be detected URL * *
function Checkbaiduinclude ($url) {
$url = ' http://www.baidu.com/s?wd= '. $url;
$curl =curl_init ();
curl_setopt ($curl, Curlopt_url, $url);
curl_setopt ($curl, curlopt_returntransfer,1);
$rs =curl_exec ($curl);
Curl_close ($curl);
if (!strpos ($rs, ' Sorry, not found ')) {return
1;
} else{return
0;
}
Meaning is very simple, such as the need to detect http://www.Alixixi.com/javascript-function/833.html this site is included, you only need:
Checkbaiduinclude (' http://www.Alixixi.com/javascript-function/833.html ');
The result is to see for yourself.