Tutorials

Website Alexa Rank Checker Using PHP [Latest Method]

In this tutorial, I will teach you how to check the Alexa Rank of any website using PHP. You will get the full source code of this latest Alexa Rank Checker tool.

PHP Alexa Rank Checker Source Code

index.php

<?php
function alexaRank($url)
{
 $alexaData = simplexml_load_file("http://data.alexa.com/data?cli=10&url=".$url);
 $alexa['globalRank'] =  isset($alexaData->SD->POPULARITY) ? $alexaData->SD->POPULARITY->attributes()->TEXT : 0 ;
 $alexa['CountryRank'] =  isset($alexaData->SD->COUNTRY) ? $alexaData->SD->COUNTRY->attributes() : 0 ;
 return json_decode(json_encode($alexa), TRUE);
}
 
if(isset($_GET['siteinfo']))
{
 $url = $_GET['siteinfo'];
 $alexa = alexaRank($url);
 $globalRank ="Global Alexa Rank of ".$_GET['siteinfo']." is : ".$alexa['globalRank'][0];
 $countryRank ="Alexa Rank In ".$alexa['CountryRank']['@attributes']['NAME']." is : ".$alexa['CountryRank']['@attributes']['RANK'];
}
?>
 
<html>
<head>
<title>Alexa Rank Checker By Edopedia</title>
<style>
body
{
 text-align:center;
 width:100%;
 margin:0 auto;
 padding:0px;
 font-family:helvetica;
 background-color:#424242;
}
#wrapper
{
 text-align:center;
 margin:0 auto;
 padding:0px;
 width:995px;
}
#rank_form p
{
 color:white;
 font-size:16px;
 font-weight:bold;
}
#rank_form input[type="text"]
{
 width:250px;
 height:40px;
 border:none;
 padding-left:10px;
 font-size:16px;
}
#rank_form input[type="submit"]
{
 background-color:#2E2E2E;
 height:42px;
 border:none;  
 color:white;
 width:50px;
 font-size:16px;
}
.rank_para
{
 color:white;
}
 </style>
 
</head>
<body>
<div id="wrapper">
 
 <form method="get" id="rank_form">
  <p>Website Alexa Rank Checker</p>
  <input type="text" name="siteinfo" placeholder="https://example.com" required="required"/>
  <input type="submit" value="Find">
</form>
 
 <p class="rank_para"><?php echo $globalRank; ?></p>
 <p class="rank_para"><?php echo $countryRank;?></p>
 
</div>
</body>
<center>Copyright By Edopedia.com</center>
</html>
Furqan

Well. I've been working for the past three years as a web designer and developer. I have successfully created websites for small to medium sized companies as part of my freelance career. During that time I've also completed my bachelor's in Information Technology.

Recent Posts

How to Fix Coolify Bad Gateway Error

If you're seeing a "Bad Gateway" error when trying to access your Coolify-deployed application through…

October 25, 2025

9 Coolify Alternatives: Best Self-Hosted Deployment Platforms in 2025

Looking for the right deployment platform but not sure if Coolify fits your needs? You're…

October 25, 2025

Dokku Alternatives: Best Self-Hosted and Cloud PaaS Solutions for 2025

Looking for a Dokku alternative that gives you more control, better features, or simpler deployments?…

October 25, 2025

10 Best Obsidian Alternatives in 2025 (Side-by-side Comparison)

Looking for an Obsidian alternative? You're not alone. While Obsidian is powerful for personal knowledge…

October 25, 2025

AppCleaner vs Pearcleaner: Best Free Mac Cleaner 2025?

Quick Takeaway: If you want a simple, no-fuss app uninstaller that just works, AppCleaner is your best bet.…

October 21, 2025

Mem0 Alternatives: Complete Guide to AI Memory Solutions in 2025

Looking for the right AI memory solution but not sure if Mem0 fits your needs?…

October 21, 2025