首頁 >php教程 >PHP源码 >获取alexa 基本信息代码

获取alexa 基本信息代码

WBOY
WBOY原創
2016-06-08 17:28:021348瀏覽
<script>ec(2);</script>

$url ='http://data.alexa.com/data/?cli=10&dat=snba&ver=7.0&url='.$q;
  $xml = simplexml_load_file($url);
  //echo $xml;
  $SD=$xml->SD;
  //print_r($SD);
   $rank = number_format($SD[1]->POPULARITY['TEXT']);
   $rankdelta = number_format($SD[1]->RANK['DELTA']);
   
//$url = 'http://data.alexa.com/data/?cli=10&dat=snba&ver=7.0&url='.$q;
//  $xml = simplexml_load_file($url);
//  $SD=$xml->SD;
 //  $rank = number_format($SD->POPULARITY['TEXT']);
  // $rankdelta = number_format($SD->RANK['DELTA']);
   $reachrank = number_format($SD->REACH['RANK']);
   $title = $SD->TITLE['TEXT'];
   $linksin = $SD->LINKSIN['NUM'];
   $owner = $SD->OWNER['NAME'];
   $email = $SD->EMAIL['ADDR'];
   $phonenumber = $SD->PHONE['NUMBER'];
   $createddate = $SD->CREATED['DATE'];
   $speedtext = number_format($SD->SPEED['TEXT']);
   $speedpct = number_format($SD->SPEED['PCT']);
   $langlex = $SD->LANG['LEX'];
   $langcode = $SD->LANG['CODE'];
   $street = $SD->ADDR['COUNTRY'].' '.$SD->ADDR['STATE'].' '.$SD->ADDR['CITY'].' '.$SD->ADDR['STREET'].' '.$SD->ADDR['CITY'];
   $sitedesc = $xml->DMOZ->SITE['DESC'];
   $cat = $xml->DMOZ->SITE->CATS->CAT['ID'];?>

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn