最近一直在忙友链,也乘机学习一下PR值相关知识,试着用PHP实现PR查询。
Google PR值是什么在此不做过多的介绍,简单的说就是你的PR值越高代表的你网站越重要越受欢迎,不过这个值最高为10,下面这个代码可以获得一个网站的PR值。
用PHP脚本程序获取网站的PR值的主要代码如下:
程序如下:
$googlehost="toolbarqueries.google.com";
$googleua="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5";
echo getpr
//convert a string to a 32-bit integer
function StrToNum($Str, $Check, $Magic) {
$Int32Unit = 4294967296; // 2^32
$length = strlen($Str);
for ($i = 0; $i
$Check *= $Magic;
//If the float is beyond the boundaries of integer (usually +/- 2.15e+9 = 2^31),
// the result of converting to integer is undefined
// refer to php.net/manual/en/language.types.integer.php
if ($Check >= $Int32Unit) {
$Check = ($Check - $Int32Unit * (int) ($Check / $Int32Unit));
//if the check less than -2^31
$Check = ($Check
}
$Check += ord($Str{$i});
}
return $Check;
}
//genearate a hash for a url
function HashURL($String) {
$Check1 = StrToNum($String, 0×1505, 0×21);
$Check2 = StrToNum($String, 0, 0×1003F);
$Check1 》= 2;
$Check1 = (($Check1 》 4) & 0×3FFFFC0 ) ($Check1 & 0×3F);
$Check1 = (($Check1 》 4) & 0×3FFC00 ) ($Check1 & 0×3FF);
$Check1 = (($Check1 》 4) & 0×3C000 ) ($Check1 & 0×3FFF);
$T1 = (((($Check1 & 0×3C0) 《 4) ($Check1 & 0×3C)) 《2 ) ($Check2 & 0xF0F );
$T2 = (((($Check1 & 0xFFFFC000) 《 4) ($Check1 & 0×3C00)) 《 0xA) ($Check2 & 0xF0F0000 );
return ($T1 $T2);
}
//genearate a checksum for the hash string
function CheckHash($Hashnum) {
$CheckByte = 0;
$Flag = 0;
$HashStr = sprintf(‘%u’, $Hashnum) ;
$length = strlen($HashStr);
for ($i = $length - 1; $i >= 0; $i –) {
$Re = $HashStr{$i};
if (1 === ($Flag % 2)) {
$Re += $Re;
$Re = (int)($Re / 10) + ($Re % 10);
}
$CheckByte += $Re;
$Flag ++;
}
$CheckByte %= 10;
if (0 !== $CheckByte) {
$CheckByte = 10 - $CheckByte;
if (1 === ($Flag % 2) ) {
if (1 === ($CheckByte % 2)) {
$CheckByte += 9;
}
$CheckByte 》= 1;
}
}
return "7".$CheckByte.$HashStr;
}

Kernelsecuritycheckfailure(内核检查失败)就是一个比较常见的停止代码类型,可蓝屏错误出现不管是什么原因都让很多的有用户们十分的苦恼,下面就让本站来为用户们来仔细的介绍一下17种解决方法吧。kernel_security_check_failure蓝屏的17种解决方法方法1:移除全部外部设备当您使用的任何外部设备与您的Windows版本不兼容时,则可能会发生Kernelsecuritycheckfailure蓝屏错误。为此,您需要在尝试重新启动计算机之前拔下全部外部设备。

使用Java的String.valueOf()函数将基本数据类型转换为字符串在Java开发中,当我们需要将基本数据类型转换为字符串时,一种常见的方法是使用String类的valueOf()函数。这个函数可以接受基本数据类型的参数,并返回对应的字符串表示。在本文中,我们将探讨如何使用String.valueOf()函数进行基本数据类型转换,并提供一些代码示例来

char数组转string的方法:可以通过赋值来实现,使用{char a[]=" abc d\0efg ";string s=a;}语法,让char数组对string直接赋值,执行代码即可完成转换。

本文将指导您在Windows11/10PC上关闭PalmCheck功能。PalmCheck是一项设计用来防止在键盘输入时意外手掌或其他部位的触摸被误识别为输入的功能。通常可以在触摸板设置中找到,特别是在笔记本电脑等设备上具有触摸功能的设备。有时候,您可能需要关闭PalmCheck或类似的功能,以便在需要同时使用键盘和触摸板的情况下更加灵活地控制输入。在本文中,我们将介绍如何在Windows11/10PC上禁用PalmCheck功能,让您能够更好地应对游戏或运行应用程序时的需求。什么是触摸板上的P

使用Java的String.replace()函数替换字符串中的字符(串)在Java中,字符串是不可变的对象,这意味着一旦创建了一个字符串对象,就无法修改它的值。但是,你可能会遇到需要替换字符串中的某些字符或者字符串的情况。这时候,我们可以使用Java的String类中的replace()方法来实现字符串的替换。String类的replace()方法有两种重

大家好,今天给大家分享java基础知识之String。String类的重要性就不必说了,可以说是我们后端开发用的最多的类,所以,很有必要好好来聊聊它。

使用Java的String.length()函数获取字符串的长度在Java编程中,字符串是一种非常常见的数据类型,我们经常需要获取字符串的长度,即字符串中字符的个数。在Java中,我们可以使用String类的length()函数来获取字符串的长度。下面是一个简单的示例代码:publicclassStringLengthExample{publ

一、认识String1.JDK中的String首先我们看看JDK中的String类源码,它实现了很多接口,可以看到String类被final修饰了,这就说明String类不可以被继承,String不存在子类,这样所有使用JDK的人,用到的String类都是同一个,如果String允许被继承,每个人都可以对String进行扩展,每个人使用的String都不是同一个版本,两个不同的人使用相同的方法,表现出不同的结果,这就导致代码没办法进行开发了继承和方法覆写在带来灵活性的同时,也会带来很多子类行为不


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SublimeText3 Linux new version
SublimeText3 Linux latest version

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Atom editor mac version download
The most popular open source editor

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),