World search engine rankings using PHP to query search engine ranking Location code

Source: Internet
Author: User
Copy the Code code as follows:


/*
Search Google "Shenzhen photography studio", Lan Horizon LANSJ ranking position; 2009-10-11
Lost63.com Original
Search in the first 30 pages
*/
$page = 30; Number of pages
$domain = "lansj.com"; Domain name
$domain = "lost63.com";
for ($n =0; $n <= $page; $n + +) {
$url = ' http://www.google.cn/search?hl=zh-CN&newwindow=1&q=%E6%B7%B1%E5%9C%B3%E6%91%84%E5%BD%B1%E5%B7%A5 %e4%bd%9c%e5%ae%a4&start= '. $n. ' 0&sa=n ';
$url = ' http://www.google.cn/search?hl=zh-CN&lr=&newwindow=1&q=%E8%BF%B7%E5%A4%B1%E8%B7%AF%E4%B8% 8a&start= '. $n. ' 0&sa=n ';
$file =fopen ($url, "R");
while (!feof ($file))
{
$result. =fgets ($file, 9999);
}
if (Strpos ($result, $domain) ==true) {
Echo ' was found on page $n.
';
$n = $page;
}else{
Echo ' first ' $n. ' Page not found
';
}
Fclose ($file);
}
?>

The above describes the world search engine rankings with PHP query search engine ranking location of the code, including the World search engine rankings of content, I hope that the PHP tutorial interested in a friend helpful.

  • 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.