The PR value is one of the most important criteria for Google to measure the site, according to Google's results to obtain the PR value, such as:
Http://toolbarqueries.google.com.hk/tbr?client=navclient-auto&features=Rank:&q=info:phpddt.com&ch= 8fabc62ea
<?php
*
* Function: Code URL encoding
* parameter description: $web _url Web site URL, does not contain "http://
"
/function Hashurl ($url)
{
$SEED = "Mining PageRank is against GOOGLE ' S TERMS of SERVICE. Yes, I ' m talking to you, scammer. "
$Result = 0x01020345;
For ($i =0 $i <strlen ($url); $i + +)
{
$Result ^= ord ($SEED {$i%87}) ^ ord ($url {$i}
); $Result = (($Result >>) & 0x1ff) $Result << 9;
}
Return sprintf ("8%x", $Result);
}
* * Function: According to Google's PR query interface to obtain PageRank
* parameter description: $domain site domain name, does not include "http://"
/function PageRank ($ Domain)
{
$StartURL = "Http://toolbarqueries.google.com/tbr?client=navclient-auto&features=Rank: &q=info: ";
$GoogleURL = $StartURL. $domain. ' &ch= '. Hashurl ($domain);
echo $GoogleURL. ' <br> ';
$fcontents = file_get_contents ("$GoogleURL");
$pagerank = substr ($fcontents, 9);
if (! $pagerank) Return of "0"; else return $pagerank;
}
echo PageRank ("phpddt.com");
? >