Skip to content
WJunction - Webmaster Forum

Alexa.com alternative

Status
Not open for further replies.

9 comments

I currently use this for Alexa Rank

PHP:
    public function get_alexa_rank(){
        $api_url = "http://data.alexa.com/data?cli=10&dat=snbamz&url=".$this->url;
        $content = self::get_content($api_url);
        if (empty($content)) 
        {
            return intval(0);
        }
        else
        {
            $xml = new SimpleXMLElement($content);  
            $popularity = $xml->xpath("//POPULARITY");
            if(isset($popularity[0]['TEXT']))
            {
                $rank = (string)$popularity[0]['TEXT']; 
            }
            else
            {
                $rank = 0;
            }
            return intval($rank);
        }
    }
 
Status
Not open for further replies.

About the author

J
Active Member · Joined
31
Messages
7
Reactions
8
Points

Advertise on WJunction

Reach 1000's of webmasters, hosts & affiliates. Banner & sponsored-thread slots available.

Contact us
Back
Top Bottom