I need a php function to return the Alexa rank of a given domain. I know that there are lots of these on the web (I have successfully used some of them until now), but recently Alexa changed something on theirs system and the existing functions doesn't seem to work anymore. Please indicate me one that you have recently used and it works. Thanks to all!
I'm not sure if they provide an API, but here's how to do it by just grabbing the page... <?php $domain = "phpright.com"; // Change this to your domain $file = file_get_contents("http://www.alexa.com/siteinfo/".$domain); $file = strstr($file,'alt="Global"'); $file = substr(strstr($file,'>'),1); $file = str_replace(strstr($file,'</a>'),'',$file); $file = trim($file); echo 'Your ranking: '.$file; ?> PHP: