Home >php教程 >php手册 >php 网站反链接收录查询 google,baidu反链

php 网站反链接收录查询 google,baidu反链

WBOY
WBOYOriginal
2016-06-13 11:22:26847browse

本款主要是针对google,baidu来写的一款网站反链与收录查询哦,

本款主要是针对google,baidu来写的一款网站反链与收录查询哦,

if($site) {
 $buffer = @file_get_contents('http://www.baidu.com/s?wd=site%3A' . $site, 'r');
  if($buffer) {
   $BaiduSite = cut($buffer, '找到相关网页', '篇');
   $BaiduSite = str_replace(array('约', ','), '', $BaiduSite);
  }
 $buffer = @file_get_contents('http://www.baidu.com/s?wd=domain%3A' . $site, 'r');
  if($buffer) {
   $BaiduDomain = cut($buffer, '找到相关网页', '篇');
   $BaiduDomain = str_replace(array('约', ','), '', $BaiduDomain);
  }
 $buffer = @file_get_contents('http://www.google.cn/search?q=site%3A' . $site, 'r');
  if($buffer) {
   $GoogleSite = cut($buffer, '有 ', ' ');
   $GoogleSite = str_replace(',', '', $GoogleSite);
  } 
 $buffer = @file_get_contents('http://www.google.cn/search?q=link%3A' . $site, 'r');
  if($buffer) {
   $GoogleLink = cut($buffer, '有 ', ' 项');
   $GoogleLink = str_replace(',', '', $GoogleLink);
  }
}

include MooTemplate("site_index");

function cut($file, $from, $end) {
 $message = explode($from, $file);
 $message = explode($end, $message[1]);
 return $message[0];
}


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn