src/Base62.php
public function decode($value, $b = 62)
    {
        $limit = strlen($value);
        $result = strpos($this->base, $value[0]);

        for ($i = 1; $i < $limit; $i++) {
            $result = $b * $result + strpos($this->base, $value[$i]);
        }

        return $result;
    }
public function decode($value, $b = 62)
    {
        $limit = strlen($value);
        $result = strpos($this->base, $value[0]);

        for ($i = 1; $i < $limit; $i++) {
            $result = $b * $result + strpos($this->base, $value[$i]);
        }

        return $result;
    }
Decode a string to a integer.

@param string $value
@param int $b

@return int