• Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership from 10$ a month today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

Hàm hiển thị Alexa Rank cho PHP

Admin

Well-Known Member
Staff member
Administrator
Hàm này dùng để hiển thị Alexa Rank website
của bạn là bao nhiêu
34f887e7.gif

PHP:
function alexa_rank($diachi) {
$u = 'http://data.alexa.com/data? cli=10&dat=s&url='.$diachi; $link = $u;
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, $header); //
trace header response
curl_setopt($ch, CURLOPT_NOBODY, $header); //
return body curl_setopt($ch, CURLOPT_URL, $u); //curl
Targeted URL
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER
['HTTP_USER_AGENT']); curl_setopt($ch, CURLOPT_REFERER, $ref); //fake
referer
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$content = curl_exec($ch);
curl_close($ch); if(preg_match('<REACH RANK="(.*)"/>', $content,
$alexa_rank)) {
return $alexa_rank[1];
}
}
Alexa Rank: '.alexa_rank(' http://tuoitreit.vn').';
 

Facebook Comments

New posts New threads New resources

Back
Top