用于编码id或者短网站地址 linux 使用该函数需要打开 --enable-bcmath 0); return $str;}function base62_decode($str) { $str = strval($str); $dict = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $length = s
linux 使用该函数需要打开 --enable-bcmath 0); return $str; } function base62_decode($str) { $str = strval($str); $dict = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $length = strlen($str); $number = 0; for($i=0;$i<$length;$i++) { $pos = strpos($dict,$str[$i]); $number = bcadd(bcmul(bcpow(62,$length-$i-1),$pos),$number); } return $number; }