[PHP] GetAlexaTrafficRank

Pass through a domain without 'www' in "$domain". Read, Learn, Modify, Re-use.

Example output:


Code:
Code: 
<?php

/**
 * This is simple description.
 * 
 * @author Vick Kumar <vickkumar2011@gmail.com>
 * @copyright Seecure.me, 2012
 * @version 1.0
 * @license http://creativecommons.org/licenses/by/3.0/legalcode 
 */

function GetAlexaTrafficRank($domain)
{
        $source = file_get_contents("http://www.alexa.com/siteinfo/$domain#");
        $regex = '/is ranked (.*) in/';
        preg_match($regex, $source, $match);
        $newresult = str_replace("number", "", $match[1]);
        return $newresult;
}
echo "Seecure.ME's Alexa Traffic Rank is: ".GetAlexaTrafficRank("seecure.me").".";
?>
_Vick Reviewed by _Vick on . [PHP] GetAlexaTrafficRank GetAlexaTrafficRank Pass through a domain without 'www' in "$domain". Read, Learn, Modify, Re-use. Example output: http://screensnapr.com/e/uOxR3O.jpg Code: <?php Rating: 5