- base64_decode: documentation ( source)
- str_replace: documentation ( source)
- md5: documentation ( source)
<?php
function decode($encoded, $key)
{
$strofsym = "qwertyuiopasdfghjklzxcvbnm1234567890QWERTYUIOPASDFGHJKLZXCVBNM=";
$x = 0;
while ($x++ <= strlen($strofsym))
{
$tmp = md5(md5($key.$strofsym[$x-1]).$key);
$encoded = str_replace($tmp[3].$tmp[6].$tmp[1].$tmp[2],
$strofsym[$x-1], $encoded);
}
return base64_decode($encoded);
}
echo decode('abc', 'abv');