Get Alexa Rank with PHP

Alexa is one of the most well known and poplar web information provider. It provides information like web site's traffic status, reviews, back links and many more. The most important thing of Alexa is, it measures web site's popularity and provides its global rank. And this rank is accepted by all. Though it is very easy to know a web site' Alexa rank from Alexa's website. But now I going to show you a way to get Alexa rank with PHP code.

Alexa Rank Checker PHP Function

 * Alexa Rank with PHP
 * @param string $domain (
 * @return int || void
function alexa($domain){
  $uri = '';
  $uri .= $domain;

  $xml = simplexml_load_file($uri);

  if (isset($xml->SD[1]->POPULARITY))
    return (int) $xml->SD[1]->POPULARITY->attributes()->TEXT;


echo alexa('');




Go to top