Created
November 4, 2014 14:47
-
-
Save AndreBaumeier/c5959491626dc6d79a63 to your computer and use it in GitHub Desktop.
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 encode_alphas($n, $alphas) { | |
$result = ''; | |
for ($i=0;$i<6;$i++) { | |
$m = $n % count($alphas); | |
$n = $n / count($alphas); | |
$result .= $alphas[$m]; | |
} | |
return $result; | |
} | |
$alphas = range('a', 'z'); | |
encode_alphas(12345, $alphas); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment