PHP Check page is included in Baidu, PHP check page included _php tutorial

Source: Internet
Author: User

PHP Check page is included in Baidu, PHP check page included


Recently need to detect which pages in the site is not indexed by Baidu search engine to make relevant adjustments. Because of the use of the site command to see the fact is not to see, I think of the use of PHP programs to batch processing, research, and found that in fact very simple, the following will be the implementation of the PHP test page is included in the function of Baidu share.
Here is the specific code:

<?php/* * Detect whether the webpage is included in Baidu, return 1 is included return 0 means not included * @ param string $url The URL to be detected */function Checkbaiduinclude ($url) {  $url = ' h Ttp://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;  

The meaning is very simple, for example need to detect http://www.bkjia.com/article/74039.htm this URL is included, then only need:
Checkbaiduinclude (http://www.bkjia.com/article/74039.htm ');
The back result is 1 for ingest. The 0 is not included.

This article introduces to this, the website also has the related article for everybody to study, hoped that everybody's study has the help.

http://www.bkjia.com/PHPjc/1065570.html www.bkjia.com true http://www.bkjia.com/PHPjc/1065570.html techarticle PHP Check whether the page is included, PHP check page included recently need to detect which pages in the site is not indexed by Baidu search engine to make relevant adjustments. Because of the use of site life ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.