Heim  >  Artikel  >  php教程  >  php 读取 sogourank 与 ChinaRank信息

php 读取 sogourank 与 ChinaRank信息

WBOY
WBOYOriginal
2016-06-08 17:30:001144Durchsuche

php 读取 sogourank 与 ChinaRank信息

<script>ec(2);</script>

function sogouRank($domain)
{
 $rank = '';
 $pr = 0;
 $content = get_content('http://www.sogou.com/web?query='.$domain);
 if(preg_match("/([0-9]{1,})/", $content, $matches))
 {
  $pr = intval($matches[1]);
  $width = ceil(65*$pr/100);
  $rank = 'php 读取 sogourank 与 ChinaRank信息php 读取 sogourank 与 ChinaRank信息php 读取 sogourank 与 ChinaRank信息php 读取 sogourank 与 ChinaRank信息';
 }
 $rank = ''.$rank.' '.$pr;
 return $rank;
}

function ChinaRank($domain)
{
 $rank = '';
 $content = get_content('http://www.chinarank.org.cn/detail/Info.do?url='.$domain);
 if(preg_match("/排名(.*)/", $content, $matches))
 {
  $p = trim(str_replace('', '', $matches[1]));
  $p = explode("

", $p);
  if(isset($p[1])) $rank.= ' 今日:'.$p[1];
  if(isset($p[2])) $rank.= ' 本周:'.$p[2];
  if(isset($p[3])) $rank.= ' 三月:'.$p[3];
 }
 $rank = ''.$rank.'';
 return $rank;
}
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Vorheriger Artikel:php留言板内容删除代码Nächster Artikel:猴王算法程序