I am an absolute neophyte, so please bear with me. I am trying to decipher a bit of code that is used on our website that changes a number to a code for use with a shortened URL. We start with a number that links to a specific page on the website, encode it and then append it to a URL. I cannot find how the encoding function works. The number to encode is anything between a one and seven digit number. Here is the function that encodes the number:
function encryptZip($zip) {
$theSource = Array("8","v","w","M","P","I","N","o","Z","h","g","_","u","W","D","-","b","O","k","a","G","t","U","j","6","7","K","A","r","y","l","5","X","p","n","z","F","4","Y","d","2","9","q","V","s","0",".","e","H","c","x","Q","B","S");
$r = '';
while ($zip>0){
$num = $zip % 53;
$zip = ($zip - $num) / 53;
$r .= $theSource[$num];
}
return $r;
}
Thanks in advance for any help,
RDW