php code to get alexa rank information

php code to get alexa rank information

php code to get alexa rank information

Here I’ going to show an easy way to get alaxa rank information of your website or other website by using php code.
Alaxa is using the alaxa toolbar for tracking the website. There alaxa track a website viewed by the browser in which alaxa toolbar are installed.

You can use these php alexa rank fetcher script to your work easly.

Here is the php code to get alexa rank information.


               $sWebSite="tekbrand.com";
			   if($source = simplexml_load_file('http://data.alexa.com/data?cli=10&url='.$sWebSite)){

                                     if($source->SD->COUNTRY['RANK']){

                                          $country    = $source->SD->COUNTRY['RANK'];
                                     }else{

                                          $country='Not Available';

                                      }

				     if($source->SD->POPULARITY['TEXT']){

						$popularity 	= $source->SD->POPULARITY['TEXT'];

				      }else{

						$popularity='Not Available';

				      }
				      if($source->SD->REACH['RANK']){

					  $reach=$source->SD->REACH['RANK'];
				      }else{

					   $reach='Not Available';

				      }
			         }else{

					$country='Not Available';
					$popularity='Not Available';
					$reach='Not Available';
			   }

 


  $source = simplexml_load_file('http://data.alexa.com/data?cli=10&url='.$sWebSite)

  

The above php code is used to pass to alaxa to get alexa rank information.

In this we are passing our website information to alaxa. in return alaxa will give a xml file in which our website information will be present.
So this is my php code to get alexa rank information. Hop this php alexa rank fetcher may help you too.