Convert String to int php

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
Run Code Online (Sandbox Code Playgroud)

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-...]
Run Code Online (Sandbox Code Playgroud)

以上自煮脚本是否很好或者是否有某些标准功能在php中完成这项工作?

San*_*osh 5

简单使用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);
        }
Run Code Online (Sandbox Code Playgroud)

例10183491225753109122105505667.这是30位长的数字,但是如果你想要一个唯一的数字,那么这就是它.