php modify string math
<p>How can the following be modified to return short code: eMn1 instead of single digit/char for shortened URL?</p>

<pre><code>define('ALLOWED_CHARS', '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ');
function getShortenedURLFromID ($integer, $base = ALLOWED_CHARS)
    {
        $length = strlen($base);
        while($integer &gt; $length - 1)
        {
            $out = $base[fmod($integer, $length)] . $out;
            $integer = floor( $integer / $length );
        }
        return $base[$integer] . $out;
    }
</code></pre>

<p>Ex: facebook.com returns shorturl.tld/6</p>
