- round: documentation ( source)
<?php
echo shortenb64(2773545392);
function shortenb64($id, $alphabet=base64alphabet)
{
$base = strlen($alphabet);
$short = '';
while($id) {
$id = round(($id-($r=$id%$base))/$base);
$short = $alphabet{$r} . $short;
}
return $short;
}