Skip to content

Instantly share code, notes, and snippets.

@tutweb
Last active April 19, 2019 18:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tutweb/4cb38af381c1d479c8db56ed4666550a to your computer and use it in GitHub Desktop.
Save tutweb/4cb38af381c1d479c8db56ed4666550a to your computer and use it in GitHub Desktop.
PHP Alexa Rank Checker
<?php
/**
* Ranking Alexa dengan PHP
*
* @param string $domain (www.jurnalweb.com)
* @return int || void
*/
function AlexaRank($domain){
$uri = 'http://data.alexa.com/data?cli=10&dat=snbamz&url=';
$uri .= $domain;
$xml = simplexml_load_file($uri);
// Data apa saja yang didapat bisa Anda lihat dengan fungsi print_r($xml)
//print_r($xml); die;
if (isset($xml->SD[1]->POPULARITY))
return (int) $xml->SD[1]->POPULARITY->attributes()->TEXT;
}
echo "Ranking Alexa Jurnalweb.com adalah: ".AlexaRank('jurnalweb.com');
?>
@IsaacMontero
Copy link

no longer available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment