Skip to content

Instantly share code, notes, and snippets.

@AndreBaumeier
Created November 4, 2014 14:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndreBaumeier/c5959491626dc6d79a63 to your computer and use it in GitHub Desktop.
Save AndreBaumeier/c5959491626dc6d79a63 to your computer and use it in GitHub Desktop.
<?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