Created
October 28, 2010 13:02
-
-
Save victorbstan/651281 to your computer and use it in GitHub Desktop.
Shortest ID based URL 'shortener' script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function shortly($id) | |
{ | |
return base_convert($id, 10, 36); | |
} | |
function unShortly($base) | |
{ | |
return base_convert($base, 36, 10); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment