php 26进制
//26进制转换
function bb10($cc)
{
$len = strlen($cc);
$res = 0;
for($i=0,$j=1;$i<$len;$i++,$j*=26){
$res +=(int)(ord($cc[$len-$i-1])-64)*$j;
}
echo $res;
}
function aa26($index)
{
$res = "";
while($index>0){
$i = $index%26;
if($i==0)$i=26;
$res.=chr($i+64);
$index=($index-$i)/26;
}
echo strrev($res);
}
aa26(703);
bb10("AAA");
浙公网安备 33010602011771号