Exception or error:
I want to get Alexa rank in my clientside, but I don’t know the proper way to do it. while running localhost it working, when using on my hosted website its not.
<?php $xml = simplexml_load_file('http://data.alexa.com/data?cli=10&dat=snbamz&url=linkedin.com'); $rank=isset($xml->SD->POPULARITY)?$xml->SD->POPULARITY->attributes()->TEXT:0; $web=(string)$xml->SD->attributes()->HOST; echo $web." has Alexa Rank ".$rank; ?>
How to solve: