Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function convert_to_base62($n)
- {
- $base = 62;
- $str = "";
- while ($n != 0)
- {
- $r = $n % $base;
- $n = (int)($n / $base);
- if($r >= 10 && $r <= 35)
- {
- $str .= chr(87 + $r );
- }
- else if($r >= 36 && $r <= 61)
- {
- $str .= chr(29 + $r);
- }
- else
- {
- $str .= (string)$r;
- }
- }
- return strrev($str);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement