Last active
March 16, 2019 23:43
-
-
Save tayfunerbilen/7679514 to your computer and use it in GitHub Desktop.
php alexa bilgileri
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// site url | |
$url = 'http://www.erbilen.net'; | |
// get data | |
$alexa = simplexml_load_file('http://data.alexa.com/data?cli=10&url='.$url); | |
// global rank | |
$globalRank = number_format( (int) $alexa->SD->POPULARITY['TEXT'] ); | |
// country rank | |
$countryCode = $alexa->SD->COUNTRY['CODE']; | |
$countryName = $alexa->SD->COUNTRY['NAME']; | |
$countryRank = number_format( (int) $alexa->SD->COUNTRY['RANK'] ); | |
// global rank print | |
print $globalRank; | |
print '<hr />'; | |
// country rank print | |
print $countryName.' '.$countryRank; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment