Moz*_*Moz 2 php string numbers
The google books api returns a volumeid for each book. This volumeid is string like this
AZ5J6B1-4BoC
UvK1Slvkz3MC
OBM3AAAAIAAJ
So there are capital letters , small letters, characters like dash(-) underscore(_) etc
So is there a library that converts these characters to integer?
Also can I just convert the string to certain number like
[A-Z]=[0-25]
[a-z]=[26-50]
[special characters like -,_,]=[51-...]
以上自煮脚本是否很好或者是否有某些标准功能在php中完成这项工作?
简单使用http://www.php.net/manual/en/function.ord.php
function num($text)
        {
        $num=null;
        for ($i = 0; $i < strlen($text); $i++)
        {
        $num =$num.ord($text[$i]);
        }
        return($num);
        }
例10183491225753109122105505667.这是30位长的数字,但是如果你想要一个唯一的数字,那么这就是它.